[Pkg-mozext-commits] [nosquint] 12/13: Disable exceptions tab buttons on open

David Prévot taffit at moszumanska.debian.org
Tue Apr 28 01:41:25 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag 2.1.7
in repository nosquint.

commit 906720d55fb00127ae23ff8b1c2e19d60e277d98
Author: Jason Tackaberry <tack at urandom.ca>
Date:   Sun Mar 31 20:31:33 2013 -0400

    Disable exceptions tab buttons on open
    
    On open, nothing is selected in the exceptions list, so it doesn't make
    sense that these buttons are clickable (and they do nothing anyway).
---
 src/content/dlg-global.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/content/dlg-global.js b/src/content/dlg-global.js
index 1a08ca3..03bfdc7 100644
--- a/src/content/dlg-global.js
+++ b/src/content/dlg-global.js
@@ -42,6 +42,7 @@ NoSquint.dialogs.global = NoSquint.ns(function() { with (NoSquint) {
         for (let exc in iter(NSQ.prefs.exceptions))
             this.exceptionsListAdd(exc[0].replace(/%20/g, ' '), false);
         $('exceptionsList').setUserData('nosquint.changed', false, null);
+        this.excListSelect();
     };
 
     this.focus = function() {
@@ -208,8 +209,9 @@ NoSquint.dialogs.global = NoSquint.ns(function() { with (NoSquint) {
 
     this.excListSelect = function() {
         // Edit/Remove buttons enabled when one of the listitems is selected.
-        $('exceptionRemove-button').disabled = ($('exceptionsList').selectedItems.length == 0);
-        $('exceptionEdit-button').disabled = ($('exceptionsList').selectedItems.length != 1);
+        var nsel = $('exceptionsList').selectedItems.length;
+        $('exceptionRemove-button').disabled = (nsel == 0);
+        $('exceptionEdit-button').disabled = (nsel != 1);
     };
 
     this.buttonCopyFromURL = function() {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/nosquint.git



More information about the Pkg-mozext-commits mailing list