diff options
author | Go MAEDA <maeda@farend.jp> | 2020-03-22 05:25:39 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2020-03-22 05:25:39 +0000 |
commit | fb7d3bf7cefa9aa7d2d3ef5ee8dd1613be42dd9b (patch) | |
tree | 9aaa3adaa261fc17d91c2b972cd55af9f390dd9c /app | |
parent | 6acc4397048b2d22413655e18afdf4cd1009ad9c (diff) | |
download | redmine-fb7d3bf7cefa9aa7d2d3ef5ee8dd1613be42dd9b.tar.gz redmine-fb7d3bf7cefa9aa7d2d3ef5ee8dd1613be42dd9b.zip |
Clean up toggleMultiSelect js function (#32813).
Patch by Mizuki ISHIKAWA.
git-svn-id: http://svn.redmine.org/redmine/trunk@19604 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/views/workflows/edit.html.erb | 23 | ||||
-rw-r--r-- | app/views/workflows/permissions.html.erb | 20 |
2 files changed, 5 insertions, 38 deletions
diff --git a/app/views/workflows/edit.html.erb b/app/views/workflows/edit.html.erb index 3f3e3c2f5..c247097a4 100644 --- a/app/views/workflows/edit.html.erb +++ b/app/views/workflows/edit.html.erb @@ -15,13 +15,13 @@ <p> <label><%=l(:label_role)%>: <%= options_for_workflow_select 'role_id[]', Role.sorted.select(&:consider_workflow?), @roles, :id => 'role_id', :class => 'expandable' %> + <span class="toggle-multiselect icon-only"></span> </label> - <a href="#" data-expands="#role_id"><span class="toggle-multiselect icon-only icon-toggle-plus"></span></a> <label><%=l(:label_tracker)%>: <%= options_for_workflow_select 'tracker_id[]', Tracker.sorted, @trackers, :id => 'tracker_id', :class => 'expandable' %> + <span class="toggle-multiselect icon-only"></span> </label> - <a href="#" data-expands="#tracker_id"><span class="toggle-multiselect icon-only icon-toggle-plus"></span></a> <%= submit_tag l(:button_edit), :name => nil %> @@ -57,21 +57,4 @@ </div> <%= submit_tag l(:button_save) %> <% end %> -<% end %> - -<%= javascript_tag do %> -$("a[data-expands]").click(function(e){ - e.preventDefault(); - var target = $($(this).attr("data-expands")); - if (target.attr("multiple")) { - $(this).find('span').switchClass('icon-toggle-minus', 'icon-toggle-plus'); - target.attr("multiple", false); - target.find("option[value=all]").show(); - } else { - $(this).find('span').switchClass('icon-toggle-plus', 'icon-toggle-minus'); - target.attr("multiple", true); - target.find("option[value=all]").attr("selected", false).hide(); - } -}); - -<% end %> +<% end %>
\ No newline at end of file diff --git a/app/views/workflows/permissions.html.erb b/app/views/workflows/permissions.html.erb index f2e9fff7b..0b27c378d 100644 --- a/app/views/workflows/permissions.html.erb +++ b/app/views/workflows/permissions.html.erb @@ -15,14 +15,13 @@ <p> <label><%=l(:label_role)%>: <%= options_for_workflow_select 'role_id[]', Role.sorted.select(&:consider_workflow?), @roles, :id => 'role_id', :class => 'expandable' %> + <span class="toggle-multiselect icon-only"></span> </label> - <a href="#" data-expands="#role_id"><span class="toggle-multiselect icon-only icon-toggle-plus"></span></a> <label><%=l(:label_tracker)%>: <%= options_for_workflow_select 'tracker_id[]', Tracker.sorted, @trackers, :id => 'tracker_id', :class => 'expandable' %> + <span class="toggle-multiselect icon-only"></span> </label> - <a href="#" data-expands="#tracker_id"><span class="toggle-multiselect icon-only icon-toggle-plus"></span></a> - <%= submit_tag l(:button_edit), :name => nil %> <%= hidden_field_tag 'used_statuses_only', '0', :id => nil %> @@ -107,19 +106,4 @@ $("a.repeat-value").click(function(e){ var selected = td.find("select").find(":selected").val(); td.nextAll('td').find("select").val(selected); }); - -$("a[data-expands]").click(function(e){ - e.preventDefault(); - var target = $($(this).attr("data-expands")); - if (target.attr("multiple")) { - $(this).find('span').switchClass('icon-toggle-minus', 'icon-toggle-plus'); - target.attr("multiple", false); - target.find("option[value=all]").show(); - } else { - $(this).find('span').switchClass('icon-toggle-plus', 'icon-toggle-minus'); - target.attr("multiple", true); - target.find("option[value=all]").attr("selected", false).hide(); - } -}); - <% end %> |