[Pkg-mozext-commits] [firetray] 02/12: Cleaning.

David Prévot taffit at moszumanska.debian.org
Fri Oct 17 13:38:12 UTC 2014


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

taffit pushed a commit to branch master
in repository firetray.

commit 2cf236bf14cee51f41e27c802bfa0ee8db97ed59
Author: foudfou <foudil.newbie+git at gmail.com>
Date:   Sun Oct 12 23:23:05 2014 +0200

    Cleaning.
    
    ...trying to less alter "oncommand" attributes, following AMO review.
    addEventListener() won't help here (see
    http://forums.mozillazine.org/viewtopic.php?f=19&t=2696969).
    
    Note: There seem to be some cases where we would want to keep "oncommand" or
    "command" attributes (setting them to "void(0);"), for ex. for <key> elements
    (see http://stackoverflow.com/q/16779316/421846).
---
 src/chrome/content/options.js | 2 +-
 src/chrome/content/overlay.js | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/chrome/content/options.js b/src/chrome/content/options.js
index 00911c3..3c9a730 100644
--- a/src/chrome/content/options.js
+++ b/src/chrome/content/options.js
@@ -78,7 +78,7 @@ var firetrayUIOptions = {
      'ui_radiogroup_scroll'].forEach(function(id){
        document.getElementById(id).hidden = true;
      });
-    document.getElementById("ui_scroll_hides").setAttribute("oncommand", void(0));
+    document.getElementById("ui_scroll_hides").removeAttribute("oncommand");
 
     // mail prefs
     document.getElementById("newmail_icon_names").hidden = true;
diff --git a/src/chrome/content/overlay.js b/src/chrome/content/overlay.js
index 2ea10a9..4642367 100644
--- a/src/chrome/content/overlay.js
+++ b/src/chrome/content/overlay.js
@@ -79,8 +79,8 @@ var firetrayChrome = { // each new window gets a new firetrayChrome !
       let fInfo = firetrayChrome.replaceCommand(id, button.new);
       if (fInfo) {
         button.old = fInfo[0];
-        firetray_log.debug('replaced command='+button.id+' type='+fInfo[1]+' func='+fInfo[0]);
         button.type = fInfo[1];
+        firetray_log.debug('replaced command='+id+' type='+fInfo[1]+' func='+fInfo[0]);
       }
     }, this);
   },
@@ -120,7 +120,7 @@ var firetrayChrome = { // each new window gets a new firetrayChrome !
       type = FIRETRAY_XUL_ATTRIBUTE_ONCOMMAND;
       let prev = elt.getAttribute("oncommand");
       old = new Function(prev);
-      elt.setAttribute("oncommand", void(0));
+      elt.removeAttribute("oncommand");
       elt.addEventListener('command', func, false);
     } else {
       firetray_log.warn('Could not replace oncommand on '+eltId);

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



More information about the Pkg-mozext-commits mailing list