]> source.dussan.org Git - redmine.git/commitdiff
Switch between toggle plus and minus icons for toggle multi select (#31496).
authorGo MAEDA <maeda@farend.jp>
Sun, 2 Jun 2019 08:48:00 +0000 (08:48 +0000)
committerGo MAEDA <maeda@farend.jp>
Sun, 2 Jun 2019 08:48:00 +0000 (08:48 +0000)
Patch by Marius BALTEANU.

git-svn-id: http://svn.redmine.org/redmine/trunk@18214 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/workflows/edit.html.erb
app/views/workflows/permissions.html.erb
public/javascripts/application.js
public/stylesheets/application.css

index 66d9b71eee4bfb5ec2a09d56d451901615b78baf..66eb11a861b447d2d4d51a05ed5ed9841526f873 100644 (file)
   <label><%=l(:label_role)%>:
   <%= options_for_workflow_select 'role_id[]', Role.sorted.select(&:consider_workflow?), @roles, :id => 'role_id', :class => 'expandable' %>
   </label>
-  <a href="#" data-expands="#role_id"><span class="toggle-multiselect"></span></a>
+  <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' %>
   </label>
-  <a href="#" data-expands="#tracker_id"><span class="toggle-multiselect"></span></a>
+  <a href="#" data-expands="#tracker_id"><span class="toggle-multiselect icon-only icon-toggle-plus"></span></a>
 
   <%= submit_tag l(:button_edit), :name => nil %>
 
@@ -64,9 +64,11 @@ $("a[data-expands]").click(function(e){
   e.preventDefault();
   var target = $($(this).attr("data-expands"));
   if (target.attr("multiple")) {
+    $(event.target).switchClass('icon-toggle-minus', 'icon-toggle-plus');
     target.attr("multiple", false);
     target.find("option[value=all]").show();
   } else {
+    $(event.target).switchClass('icon-toggle-plus', 'icon-toggle-minus');
     target.attr("multiple", true);
     target.find("option[value=all]").attr("selected", false).hide();
   }
index 0983bb740be4861a570fbdf2d60c4ba75cd63f6d..a9af3d20825052589ca2968ea664ee02a4b01aec 100644 (file)
   <label><%=l(:label_role)%>:
   <%= options_for_workflow_select 'role_id[]', Role.sorted.select(&:consider_workflow?), @roles, :id => 'role_id', :class => 'expandable' %>
   </label>
-  <a href="#" data-expands="#role_id"><span class="toggle-multiselect"></a>
+  <a href="#" data-expands="#role_id"><span class="toggle-multiselect icon-only icon-toggle-plus"></a>
 
   <label><%=l(:label_tracker)%>:
   <%= options_for_workflow_select 'tracker_id[]', Tracker.sorted, @trackers, :id => 'tracker_id', :class => 'expandable' %>
   </label>
-  <a href="#" data-expands="#tracker_id"><span class="toggle-multiselect"></a>
+  <a href="#" data-expands="#tracker_id"><span class="toggle-multiselect icon-only icon-toggle-plus"></a>
 
   <%= submit_tag l(:button_edit), :name => nil %>
 
index 5dfd260fc13a6c0be9622cfcc6140ab175dd08df..25dc501eaf8b5ababed3cf1c88f1fabd5b942d9e 100644 (file)
@@ -121,7 +121,8 @@ function initFilters() {
     toggleFilter($(this).val());
   });
   $('#filters-table').on('click', '.toggle-multiselect', function() {
-    toggleMultiSelect($(this).siblings('select'));
+    toggleMultiSelect($(this).siblings('select'))
+    $(this).toggleClass('icon-toggle-plus icon-toggle-minus')
   });
   $('#filters-table').on('keypress', 'input[type=text]', function(e) {
     if (e.keyCode == 13) $(this).closest('form').submit();
@@ -188,7 +189,7 @@ function buildFilterRow(field, operator, values) {
   case "list_subprojects":
     tr.find('td.values').append(
       '<span style="display:none;"><select class="value" id="values_'+fieldId+'_1" name="v['+field+'][]"></select>' +
-      ' <span class="toggle-multiselect">&nbsp;</span></span>'
+      ' <span class="toggle-multiselect icon-only icon-toggle-plus">&nbsp;</span></span>'
     );
     select = tr.find('td.values select');
     if (values.length > 1) { select.attr('multiple', true); }
index 9c7ebfb7a12797b4fd997cbdc3956de169710a96..f08ef30b6816c5a46a31f0a7eab6e51dde7f02a8 100644 (file)
@@ -531,7 +531,7 @@ fieldset#filters td.values select {min-width:130px;}
 .add-filter {width:35%; float:right; text-align: right; vertical-align: top;}
 
 #issue_is_private_wrap {float:right; margin-right:1em;}
-.toggle-multiselect {background: url(../images/bullet_toggle_plus.png) no-repeat 0% 40%; padding-left:16px; margin-left:0; margin-right:5px; cursor:pointer;}
+.toggle-multiselect { no-repeat 0% 40%; padding-left:16px; margin-left:0; margin-right:5px; cursor:pointer;}
 .buttons { font-size: 0.9em; margin-bottom: 1.4em; margin-top: 1em; }
 
 div#issue-changesets {float:right; width:45%; margin-left: 1em; margin-bottom: 1em; background: #fff; padding-left: 1em; font-size: 90%;}
@@ -1502,6 +1502,8 @@ td.gantt_selected_column .gantt_hdr,.gantt_selected_column_container {
 .icon-bookmark-off { background-image: url(../images/tag_blue_add.png); }
 .icon-sorted-asc { background-image: url(../images/arrow_down.png); }
 .icon-sorted-desc { background-image: url(../images/arrow_up.png); }
+.icon-toggle-plus { background: url(../images/bullet_toggle_plus.png) }
+.icon-toggle-minus { background: url(../images/bullet_toggle_minus.png) }
 
 .icon-file { background-image: url(../images/files/default.png); }
 .icon-file.text-plain { background-image: url(../images/files/text.png); }