From 2b6a71ec267c809cc3fea0d5c888aff61255aed8 Mon Sep 17 00:00:00 2001 From: Thomas Berezansky Date: Wed, 28 Sep 2011 19:00:56 -0400 Subject: [PATCH] Close All Tabs shortcut Enable CTRL+Click on the close tab "X" to close all tabs. Signed-off-by: Thomas Berezansky Signed-off-by: Lebbeous Fogle-Weekley --- .../xul/staff_client/chrome/content/main/menu.js | 26 +++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/Open-ILS/xul/staff_client/chrome/content/main/menu.js b/Open-ILS/xul/staff_client/chrome/content/main/menu.js index 61d239ca83..65aa26c191 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/menu.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/menu.js @@ -273,7 +273,31 @@ main.menu.prototype = { ], 'cmd_close_tab' : [ ['oncommand'], - function() { obj.close_tab(); } + function(event) { + var myEvent = event; + var closeAll = false; + if(event && event.sourceEvent) myEvent = event.sourceEvent; + // Note: The last event is not supposed to be myEvent in this if. + if(myEvent && myEvent.explicitOriginalTarget.nodeName.match(/toolbarbutton/) && myEvent.explicitOriginalTarget.command == event.originalTarget.id) { + var value = xulG.pref.getIntPref('ui.key.accelKey'); + switch(value) { + case 17: + closeAll = myEvent.ctrlKey; + break; + case 18: + closeAll = myEvent.altKey; + break; + case 224: + closeAll = myEvent.metaKey; + break; + } + } + if(closeAll) { + obj.close_all_tabs(); + } else { + obj.close_tab(); + } + } ], 'cmd_close_all_tabs' : [ ['oncommand'], -- 2.11.0