1
0
mirror of https://github.com/moparisthebest/FireTray synced 2024-08-13 15:53:47 -04:00

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).
This commit is contained in:
foudfou 2014-10-12 23:23:05 +02:00
parent 0cfe58e410
commit 2cf236bf14
2 changed files with 3 additions and 3 deletions

View File

@ -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;

View File

@ -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);