From 6927a27e51df0a421edce47c91b9321d147163a9 Mon Sep 17 00:00:00 2001 From: phasefx Date: Tue, 22 Jan 2008 19:14:07 +0000 Subject: [PATCH] util.window was relying on xulG, but when called from the main.menu framework, there is no xulG. This fixes the Operator Change regression, and the chrome Perm Denied/Re-Auth regression git-svn-id: svn://svn.open-ils.org/ILS/trunk@8464 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../staff_client/chrome/content/OpenILS/global_util.js | 6 ++++++ .../xul/staff_client/chrome/content/util/window.js | 10 +++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js b/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js index 987c2b75de..e55d4a27b5 100644 --- a/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js +++ b/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js @@ -213,4 +213,10 @@ window.open(uri, "_blank", winopts); } + function url_prefix(url) { + if (url.match(/^\//)) url = urls.remote + url; + if (! url.match(/^(http|chrome):\/\//) && ! url.match(/^data:/) ) url = 'http://' + url; + dump('url_prefix = ' + url + '\n'); + return url; + } diff --git a/Open-ILS/xul/staff_client/chrome/content/util/window.js b/Open-ILS/xul/staff_client/chrome/content/util/window.js index d8c17d0d22..60c7090d5d 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/window.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/window.js @@ -83,9 +83,13 @@ util.window.prototype = { if (typeof data.modal_xulG_stack == 'undefined') data.modal_xulG_stack = {}; /* FIXME - not a perfect key.. could imagine two top-level windows both opening modal windows */ key = url; - if (typeof xulG == 'object') if (typeof xulG.url_prefix == 'function') { - key = key.replace( xulG.url_prefix('/'), '/' ); - } + if (typeof xulG == 'object') { + if (typeof xulG.url_prefix == 'function') { + key = key.replace( xulG.url_prefix('/'), '/' ); + } + } else if (typeof url_prefix == 'function') { + key = key.replace( url_prefix('/'), '/' ); + } if (typeof data.modal_xulG_stack[key] == 'undefined') data.modal_xulG_stack[key] = []; data.modal_xulG_stack[key].push( my_xulG ); data.stash('modal_xulG_stack'); -- 2.43.2