mirror of
https://github.com/moparisthebest/FireTray
synced 2025-01-06 11:08:04 -05:00
Cleaning.
This commit is contained in:
parent
be74126c96
commit
7aca24c88a
@ -74,30 +74,29 @@ var firetrayChrome = { // each new window gets a new firetrayChrome !
|
||||
* we override the fake buttons' default actions.
|
||||
*/
|
||||
hijackTitlebarButtons: function() {
|
||||
Object.keys(this.titlebarDispatch).map(function(val, idx) {
|
||||
let fInfo = firetrayChrome.replaceCommand(val, firetrayChrome.titlebarDispatch[val]['new']);
|
||||
this.titlebarDispatch.forEach(function(button) {
|
||||
let fInfo = firetrayChrome.replaceCommand(button.id, button.new);
|
||||
if (fInfo) {
|
||||
firetrayChrome.titlebarDispatch[val]['old'] = fInfo[0];
|
||||
firetray_log.debug('replaced command='+val+' type='+fInfo[1]+' func='+fInfo[0]);
|
||||
firetrayChrome.titlebarDispatch[val]['type'] = fInfo[1];
|
||||
button.old = fInfo[0];
|
||||
firetray_log.debug('replaced command='+button.id+' type='+fInfo[1]+' func='+fInfo[0]);
|
||||
button.type = fInfo[1];
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
titlebarDispatch: {
|
||||
"titlebar-min": {new: function(e){
|
||||
titlebarDispatch: [
|
||||
{id: "titlebar-min", new: function(e){
|
||||
firetray_log.debug(' titlebar-min clicked');
|
||||
if (!firetray.Handler.onMinimize(firetrayChrome.winId))
|
||||
firetrayChrome.applyDefaultCommand("titlebar-min");
|
||||
}, old: null, type: null},
|
||||
|
||||
"titlebar-close": {new: function(e){
|
||||
{id: "titlebar-close", new: function(e){
|
||||
firetray_log.debug(' titlebar-close clicked');
|
||||
if (!firetrayChrome.onClose(null)) {
|
||||
firetrayChrome.applyDefaultCommand("titlebar-close");
|
||||
}
|
||||
}, old: null, type: null}
|
||||
},
|
||||
],
|
||||
|
||||
replaceCommand: function(eltId, func) {
|
||||
let elt = document.getElementById(eltId);
|
||||
|
Loading…
Reference in New Issue
Block a user