Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MBS-5740: Only show the 'select all' checkbox if the table contains c…

…heckboxes
  • Loading branch information...
commit c28483551e9176eeea4fcb9c22ffe62e8a2def9e 1 parent 0f609e6
@ocharles ocharles authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 root/static/scripts/common/MB/Control/SelectAll.js
View
6 root/static/scripts/common/MB/Control/SelectAll.js
@@ -25,7 +25,11 @@ MB.Control.SelectAll = function (table) {
self.$checkboxes = self.$table.find('td input[type="checkbox"]');
self.lastChecked = null;
- self.$table.find('th input[type="checkbox"]').change(function() {
+ self.$selector = self.$table.find('th input[type="checkbox"]');
+
+ self.$selector.toggle(self.$checkboxes.length > 0);
+
+ self.$selector.change(function() {
var $input = $(this);
self.$checkboxes.prop('checked', $input.prop('checked'));
});
Please sign in to comment.
Something went wrong with that request. Please try again.