Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Handle the '(Un)Check all' link. #994

  • Loading branch information...
commit 43723385c62cf49596de1379a28a24ab2ef336a3 1 parent 93abdcf
@EspadaV8 EspadaV8 authored committed
View
3  app/views/issues/_list.rhtml
@@ -3,8 +3,7 @@
<div class="autoscroll">
<table class="list issues">
<thead><tr>
- <th class="checkbox hide-when-print"><%= link_to image_tag('toggle_check.png'), {}, :onclick => 'toggleIssuesSelection(Element.up(this, "form")); return false;',
- :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}" %>
+ <th class="checkbox hide-when-print"><%= link_to image_tag('toggle_check.png'), {}, :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}" %>
</th>
<%= sort_header_tag('id', :caption => '#', :default_order => 'desc') %>
<% query.columns.each do |column| %>
View
20 public/javascripts/context_menu.jquery.js
@@ -3,6 +3,7 @@
var element = el;
var opts = options;
var observingContextMenuClick;
+ var observingToggleAllClick;
var lastSelected = null;
var menu;
var menuId = 'context-menu';
@@ -194,6 +195,20 @@
inputs.each(function() {
inputs.attr('checked', checked ? 'checked' : false);
});
+ },
+ toggleIssuesSelection: function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ var issues = $(this).parents('form').find('tr.issue');
+ var checked = methods.isSelected(issues.eq(0));
+ issues.each(function() {
+ var self = $(this);
+ if(checked) {
+ methods.removeSelection(self)
+ } else {
+ methods.addSelection(self);
+ }
+ });
}
};
@@ -205,6 +220,11 @@
observingContextMenuClick = true;
}
+ if(!observingToggleAllClick) {
+ element.find('.issues img[alt="Toggle_check"]').bind('click', methods.toggleIssuesSelection);
+ observingToggleAllClick = true;
+ }
+
methods.unselectAll();
};
Please sign in to comment.
Something went wrong with that request. Please try again.