From 505b571c742fd36fe1e3aa49beb3c189c3f74be6 Mon Sep 17 00:00:00 2001 From: miker Date: Sat, 5 Apr 2008 11:44:42 +0000 Subject: [PATCH] display the lasso name when appropriate git-svn-id: svn://svn.open-ils.org/ILS/trunk@9236 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/opac/common/js/init.js | 6 ++++- Open-ILS/web/opac/common/js/opac_utils.js | 6 ++++- .../web/opac/skin/default/js/result_common.js | 26 ++++++++++--------- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/Open-ILS/web/opac/common/js/init.js b/Open-ILS/web/opac/common/js/init.js index def2002249..a5463ea6a0 100644 --- a/Open-ILS/web/opac/common/js/init.js +++ b/Open-ILS/web/opac/common/js/init.js @@ -46,7 +46,11 @@ function init() { runEvt("common", "run"); //checkUserSkin(); - G.ui.common.now_searching.appendChild(text(findOrgUnit(getLocation()).name())); + + var loc = findOrgLasso(getLasso()); + if (!loc) loc = findOrgUnit(getLocation()); + + G.ui.common.now_searching.appendChild(text(loc.name())); } function windowUnload() { runEvt("common", "unload"); } diff --git a/Open-ILS/web/opac/common/js/opac_utils.js b/Open-ILS/web/opac/common/js/opac_utils.js index cd1341199a..2a2da8bbbd 100644 --- a/Open-ILS/web/opac/common/js/opac_utils.js +++ b/Open-ILS/web/opac/common/js/opac_utils.js @@ -790,8 +790,12 @@ function orgSelect(id) { showCanvas(); runEvt("common", "locationChanged", id, findOrgDepth(id) ); + + var loc = findOrgLasso(getLasso()); + if (!loc) loc = findOrgUnit(id); + removeChildren(G.ui.common.now_searching); - G.ui.common.now_searching.appendChild(text(findOrgUnit(id).name())); + G.ui.common.now_searching.appendChild(text(loc.name())); } function setFontSize(size) { diff --git a/Open-ILS/web/opac/skin/default/js/result_common.js b/Open-ILS/web/opac/skin/default/js/result_common.js index 5ca64ea07c..c4006641f6 100644 --- a/Open-ILS/web/opac/skin/default/js/result_common.js +++ b/Open-ILS/web/opac/skin/default/js/result_common.js @@ -102,19 +102,21 @@ function resultCollectSearchIds( type, method, handler ) { displaying, links to the next/prev pages, etc. */ function resultSetHitInfo() { - - /* tell the user where the results are coming from */ - var baseorg = findOrgUnit(getLocation()); - var depth = getDepth(); - var mydepth = findOrgDepth(baseorg); - if( findOrgDepth(baseorg) != depth ) { - var tmporg = baseorg; - while( mydepth > depth ) { - mydepth--; - tmporg = findOrgUnit(tmporg.parent_ou()); + var lasso = getLasso(); + if (!lasso) { + /* tell the user where the results are coming from */ + var baseorg = findOrgUnit(getLocation()); + var depth = getDepth(); + var mydepth = findOrgDepth(baseorg); + if( findOrgDepth(baseorg) != depth ) { + var tmporg = baseorg; + while( mydepth > depth ) { + mydepth--; + tmporg = findOrgUnit(tmporg.parent_ou()); + } + unHideMe($('including_results_for')); + $('including_results_location').appendChild(text(tmporg.name())); } - unHideMe($('including_results_for')); - $('including_results_location').appendChild(text(tmporg.name())); } -- 2.43.2