MBS-5740: Only show the 'select all' checkbox if the table contains checkboxes #22

Closed
wants to merge 1 commit into
from
Jump to file or symbol
Failed to load files and symbols.
+5 −1
Split
@@ -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'));
});