Skip to content

Commit

Permalink
Simplify handleCommand()
Browse files Browse the repository at this point in the history
(related to #99)
  • Loading branch information
Infocatcher committed Sep 13, 2013
1 parent ac5ef40 commit 546b0e5
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -1469,21 +1469,16 @@ var windowsObserver = {
},
handleCommand: function(window, cmd, shifted, closeMenus, e) {
_log("handleCommand: " + cmd);
if(cmd == "openInNewPrivateTab")
this.openInNewPrivateTab(window, shifted);
else if(cmd == "openNewPrivateTab")
this.openNewPrivateTab(window);
else if(cmd == "toggleTabPrivate")
this.toggleContextTabPrivate(window, shifted);
else if(cmd == "openPlacesInNewPrivateTab")
this.openPlaceInNewPrivateTab(window, shifted, e);
else if(cmd == "openPlacesInPrivateTabs")
this.openPlacesInPrivateTabs(window, e, false);
else if(cmd == "openPlacesContainerInPrivateTabs")
this.openPlacesInPrivateTabs(window, e, true);
else {
var caller = Components.stack.caller;
throw new Error(LOG_PREFIX + 'Unknown command: "' + cmd + '"', caller.filename, caller.lineNumber);
switch(cmd) {
case "openInNewPrivateTab": this.openInNewPrivateTab(window, shifted); break;
case "openNewPrivateTab": this.openNewPrivateTab(window); break;
case "toggleTabPrivate": this.toggleContextTabPrivate(window, shifted); break;
case "openPlacesInNewPrivateTab": this.openPlaceInNewPrivateTab(window, shifted, e); break;
case "openPlacesInPrivateTabs": this.openPlacesInPrivateTabs(window, e, false); break;
case "openPlacesContainerInPrivateTabs": this.openPlacesInPrivateTabs(window, e, true); break;
default:
var caller = Components.stack.caller;
throw new Error(LOG_PREFIX + 'Unknown command: "' + cmd + '"', caller.filename, caller.lineNumber);
}
},
keypressHandler: function(e) {
Expand Down

0 comments on commit 546b0e5

Please sign in to comment.