From d0cf6dcbf50e6ded504a5a845b18bb21c186d8f5 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 26 Sep 2013 13:05:26 -0700 Subject: [PATCH] LP#1086458: define custom event for refreshing the checkout page Using a custom event handled by a chrome event handler rather than calling xulG.set_tab() directly avoids any possibility of leaking objects and executation contexts from the code that's requesting refresh of the checkout page. Signed-off-by: Galen Charlton --- Open-ILS/xul/staff_client/chrome/content/main/menu.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 d9db611430..402b13f559 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/menu.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/menu.js @@ -1683,6 +1683,20 @@ main.menu.prototype = { obj.sort_menu(document.getElementById('main.menu.admin'), true); + document.addEventListener( + 'refresh_checkout', + function() { + try { + obj.set_tab(obj.url_prefix('XUL_PATRON_BARCODE_ENTRY'),{},{}); + } catch(E) { + obj.error.sdump('D_ERROR','tab_refresh_checkout_handler: ' + js2JSON(E)); + } + } + , + false, + true + ); + if(params['firstURL']) { obj.new_tab(params['firstURL'],{'focus':true},null); } -- 2.11.0