From: phasefx Date: Tue, 22 Jan 2008 19:11:14 +0000 (+0000) Subject: util.window was relying on xulG, but when called from the main.menu framework, there... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=0843f29c36d4940b46caef04ecf502154b4a4cb5;p=Evergreen.git 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/branches/rel_1_2@8463 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- 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');