diff options
author | Phil Hughes <me@iamphill.com> | 2016-04-15 18:06:21 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2016-04-26 11:03:04 +0300 |
commit | aa316cbfff8a3a1c416a3de6054608c96106d39f (patch) | |
tree | b670f88cb6c6caebd60401b29f70bf2467e5f200 /app/assets | |
parent | 1c8d01b05ac3e0c19d0ac21c06d6419ab884939b (diff) |
Changes dropdown toggle on search dropdowns
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/search.js.coffee | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/app/assets/javascripts/search.js.coffee b/app/assets/javascripts/search.js.coffee index cf978390aed..f435e2a33a4 100644 --- a/app/assets/javascripts/search.js.coffee +++ b/app/assets/javascripts/search.js.coffee @@ -1,8 +1,10 @@ class @Search constructor: -> + $groupDropdown = $('.js-search-group-dropdown') + $projectDropdown = $('.js-search-project-dropdown') @eventListeners() - $('.js-search-group-dropdown').glDropdown( + $groupDropdown.glDropdown( selectable: true filterable: true fieldName: 'group_id' @@ -18,11 +20,13 @@ class @Search obj.id text: (obj) -> obj.name + toggleLabel: (obj) -> + "#{$groupDropdown.data('default-label')} #{obj.name}" clicked: => @submitSearch() ) - $('.js-search-project-dropdown').glDropdown( + $projectDropdown.glDropdown( selectable: true filterable: true fieldName: 'project_id' @@ -38,6 +42,8 @@ class @Search obj.id text: (obj) -> obj.name_with_namespace + toggleLabel: (obj) -> + "#{$projectDropdown.data('default-label')} #{obj.name_with_namespace}" clicked: => @submitSearch() ) |