Add placeholder support for project_users_select_tag
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
f0f88390c1
commit
67798492bc
3 changed files with 5 additions and 3 deletions
|
@ -20,8 +20,9 @@ $ ->
|
|||
|
||||
$('.ajax-project-users-select').each (i, select) ->
|
||||
project_id = $('body').data('project-id')
|
||||
|
||||
$(select).select2
|
||||
placeholder: "Search for a user"
|
||||
placeholder: $(select).data('placeholder') || "Search for a user"
|
||||
multiple: $(select).hasClass('multiselect')
|
||||
minimumInputLength: 0
|
||||
query: (query) ->
|
||||
|
|
|
@ -13,7 +13,8 @@ module SelectsHelper
|
|||
css_class << "multiselect " if opts[:multiple]
|
||||
css_class << (opts[:class] || '')
|
||||
value = opts[:selected] || ''
|
||||
placeholder = opts[:placeholder] || 'Select user'
|
||||
|
||||
hidden_field_tag(id, value, class: css_class)
|
||||
hidden_field_tag(id, value, class: css_class, 'data-placeholder' => placeholder)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
= form_tag bulk_update_project_issues_path(@project), method: :post do
|
||||
%span Update selected issues with
|
||||
= select_tag('update[status]', options_for_select(['open', 'closed']), prompt: "Status")
|
||||
= project_users_select_tag('update[assignee_id]')
|
||||
= project_users_select_tag('update[assignee_id]', placeholder: 'Assignee')
|
||||
= select_tag('update[milestone_id]', bulk_update_milestone_options, prompt: "Milestone")
|
||||
= hidden_field_tag 'update[issues_ids]', []
|
||||
= hidden_field_tag :status, params[:status]
|
||||
|
|
Loading…
Reference in a new issue