From e6f6d38ca63480fc93c60327c50412bbcbfa28e9 Mon Sep 17 00:00:00 2001 From: Umar Sheikh Date: Tue, 3 Oct 2017 17:01:30 +0500 Subject: [PATCH 1/2] enable list of tags in tag input without typing two character, and show list on focus, fixes #1498 --- app/assets/javascripts/app/controllers/widget/tag.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/app/controllers/widget/tag.coffee b/app/assets/javascripts/app/controllers/widget/tag.coffee index ee0f4b455..996bcfcd3 100644 --- a/app/assets/javascripts/app/controllers/widget/tag.coffee +++ b/app/assets/javascripts/app/controllers/widget/tag.coffee @@ -56,7 +56,7 @@ class App.WidgetTag extends App.Controller source = "#{App.Config.get('api_path')}/tag_search" @$('.js-newTagInput').autocomplete( source: source - minLength: 2 + minLength: 0 response: (e, ui) => return if !ui return if !ui.content @@ -68,6 +68,7 @@ class App.WidgetTag extends App.Controller e.preventDefault() @newTagLabel.addClass('hide') @newTagInput.removeClass('hide').focus() + @newTagInput.trigger(jQuery.Event("keydown")) @editMode = true hideAndAddInput: => From f1417b5592aa6d9bf88d88cd1eb05bc46ccc779a Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Wed, 11 Oct 2017 10:52:51 +0200 Subject: [PATCH 2/2] Applied coffeelint. --- app/assets/javascripts/app/controllers/widget/tag.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/app/controllers/widget/tag.coffee b/app/assets/javascripts/app/controllers/widget/tag.coffee index 996bcfcd3..7b6cf5437 100644 --- a/app/assets/javascripts/app/controllers/widget/tag.coffee +++ b/app/assets/javascripts/app/controllers/widget/tag.coffee @@ -68,7 +68,7 @@ class App.WidgetTag extends App.Controller e.preventDefault() @newTagLabel.addClass('hide') @newTagInput.removeClass('hide').focus() - @newTagInput.trigger(jQuery.Event("keydown")) + @newTagInput.trigger(jQuery.Event('keydown')) @editMode = true hideAndAddInput: =>