[mb-commits] branch, mbs-5740, created. MBS-5740: Only show the 'select all' checkbox if the table contains checkboxes

MusicBrainz Git Server <[email protected]> Tue, 22 Jan 2013 16:57:11 +0000
Newsgroups gmane.comp.audio.musicbrainz.cvs
Message-ID <E1Txh9r-0006Bz-68@wiley>
The branch, mbs-5740 has been created
        at  c28483551e9176eeea4fcb9c22ffe62e8a2def9e (commit)

- Log -----------------------------------------------------------------
commit c28483551e9176eeea4fcb9c22ffe62e8a2def9e
Author: Oliver Charles <[email protected]>
Date:   Tue Jan 22 16:56:51 2013 +0000

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

diff --git a/root/static/scripts/common/MB/Control/SelectAll.js b/root/static/scripts/common/MB/Control/SelectAll.js
index 6ff710b..9239eb0 100644
--- a/root/static/scripts/common/MB/Control/SelectAll.js
+++ b/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'));
     });

-----------------------------------------------------------------------


hooks/post-receive
-- 
mb_server