Commit aa316cbf authored by Phil Hughes's avatar Phil Hughes

Changes dropdown toggle on search dropdowns

parent 1c8d01b0
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()
)
......
......@@ -3,7 +3,8 @@
- if params[:project_id].present?
= hidden_field_tag :project_id, params[:project_id]
.dropdown
%button.dropdown-menu-toggle.btn.js-search-group-dropdown{ type: "button", data: { toggle: "dropdown" } }
%button.dropdown-menu-toggle.btn.js-search-group-dropdown{ type: "button", data: { toggle: "dropdown", default_label: "Group:" } }
%span.dropdown-toggle-text
Group:
- if @group.present?
= @group.name
......@@ -20,7 +21,8 @@
= dropdown_loading
.dropdown.project-filter
%button.dropdown-menu-toggle.btn.js-search-project-dropdown{ type: "button", data: { toggle: "dropdown" } }
%button.dropdown-menu-toggle.btn.js-search-project-dropdown{ type: "button", data: { toggle: "dropdown", default_label: "Project:" } }
%span.dropdown-toggle-text
Project:
- if @project.present?
= @project.name_with_namespace
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment