##// END OF EJS Templates
Replaces the link with a checkbox to select/unselect all items in the list....
Jean-Philippe Lang -
r14347:c29727dd39fa
parent child
Show More
@@ -5,8 +5,7
5 5 <thead>
6 6 <tr>
7 7 <th class="checkbox hide-when-print">
8 <%= link_to image_tag('toggle_check.png'), {},
9 :onclick => 'toggleIssuesSelection(this); return false;',
8 <%= check_box_tag 'check_all', '', false, :class => 'toggle-selection',
10 9 :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}" %>
11 10 </th>
12 11 <% query.inline_columns.each do |column| %>
@@ -5,9 +5,7
5 5 <thead>
6 6 <tr>
7 7 <th class="checkbox hide-when-print">
8 <%= link_to image_tag('toggle_check.png'),
9 {},
10 :onclick => 'toggleIssuesSelection(this); return false;',
8 <%= check_box_tag 'check_all', '', false, :class => 'toggle-selection',
11 9 :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}" %>
12 10 </th>
13 11 <% @query.inline_columns.each do |column| %>
@@ -67,6 +67,8 function contextMenuClick(event) {
67 67 // click is outside the rows
68 68 if (target.is('a') && (target.hasClass('disabled') || target.hasClass('submenu'))) {
69 69 event.preventDefault();
70 } else if (target.is('.toggle-selection')) {
71 // nop
70 72 } else {
71 73 contextMenuUnselectAll();
72 74 }
@@ -149,6 +151,7 function contextMenuLastSelected() {
149 151 }
150 152
151 153 function contextMenuUnselectAll() {
154 $('input[type=checkbox].toggle-selection').prop('checked', false);
152 155 $('.hascontextmenu').each(function(){
153 156 contextMenuRemoveSelection($(this));
154 157 });
@@ -208,18 +211,9 function contextMenuInit(url) {
208 211 }
209 212
210 213 function toggleIssuesSelection(el) {
211 var boxes = $(el).parents('form').find('input[type=checkbox]');
212 var all_checked = true;
213 boxes.each(function(){ if (!$(this).prop('checked')) { all_checked = false; } });
214 boxes.each(function(){
215 if (all_checked) {
216 $(this).removeAttr('checked');
217 $(this).parents('tr').removeClass('context-menu-selection');
218 } else if (!$(this).prop('checked')) {
219 $(this).prop('checked', true);
220 $(this).parents('tr').addClass('context-menu-selection');
221 }
222 });
214 var checked = $(this).prop('checked');
215 var boxes = $(this).parents('table').find('input[name=ids\\[\\]]');
216 boxes.prop('checked', checked).parents('tr').toggleClass('context-menu-selection', checked);
223 217 }
224 218
225 219 function window_size() {
@@ -237,3 +231,7 function window_size() {
237 231 }
238 232 return {width: w, height: h};
239 233 }
234
235 $(document).ready(function(){
236 $('input[type=checkbox].toggle-selection').on('change', toggleIssuesSelection);
237 });
General Comments 0
You need to be logged in to leave comments. Login now