mirror of
https://github.com/moparisthebest/FireTray
synced 2025-01-07 19:48:03 -05: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:
parent
0cfe58e410
commit
2cf236bf14
@ -78,7 +78,7 @@ var firetrayUIOptions = {
|
|||||||
'ui_radiogroup_scroll'].forEach(function(id){
|
'ui_radiogroup_scroll'].forEach(function(id){
|
||||||
document.getElementById(id).hidden = true;
|
document.getElementById(id).hidden = true;
|
||||||
});
|
});
|
||||||
document.getElementById("ui_scroll_hides").setAttribute("oncommand", void(0));
|
document.getElementById("ui_scroll_hides").removeAttribute("oncommand");
|
||||||
|
|
||||||
// mail prefs
|
// mail prefs
|
||||||
document.getElementById("newmail_icon_names").hidden = true;
|
document.getElementById("newmail_icon_names").hidden = true;
|
||||||
|
@ -79,8 +79,8 @@ var firetrayChrome = { // each new window gets a new firetrayChrome !
|
|||||||
let fInfo = firetrayChrome.replaceCommand(id, button.new);
|
let fInfo = firetrayChrome.replaceCommand(id, button.new);
|
||||||
if (fInfo) {
|
if (fInfo) {
|
||||||
button.old = fInfo[0];
|
button.old = fInfo[0];
|
||||||
firetray_log.debug('replaced command='+button.id+' type='+fInfo[1]+' func='+fInfo[0]);
|
|
||||||
button.type = fInfo[1];
|
button.type = fInfo[1];
|
||||||
|
firetray_log.debug('replaced command='+id+' type='+fInfo[1]+' func='+fInfo[0]);
|
||||||
}
|
}
|
||||||
}, this);
|
}, this);
|
||||||
},
|
},
|
||||||
@ -120,7 +120,7 @@ var firetrayChrome = { // each new window gets a new firetrayChrome !
|
|||||||
type = FIRETRAY_XUL_ATTRIBUTE_ONCOMMAND;
|
type = FIRETRAY_XUL_ATTRIBUTE_ONCOMMAND;
|
||||||
let prev = elt.getAttribute("oncommand");
|
let prev = elt.getAttribute("oncommand");
|
||||||
old = new Function(prev);
|
old = new Function(prev);
|
||||||
elt.setAttribute("oncommand", void(0));
|
elt.removeAttribute("oncommand");
|
||||||
elt.addEventListener('command', func, false);
|
elt.addEventListener('command', func, false);
|
||||||
} else {
|
} else {
|
||||||
firetray_log.warn('Could not replace oncommand on '+eltId);
|
firetray_log.warn('Could not replace oncommand on '+eltId);
|
||||||
|
Loading…
Reference in New Issue
Block a user