display the lasso name when appropriate
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 5 Apr 2008 11:44:42 +0000 (11:44 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 5 Apr 2008 11:44:42 +0000 (11:44 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@9236 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/opac/common/js/init.js
Open-ILS/web/opac/common/js/opac_utils.js
Open-ILS/web/opac/skin/default/js/result_common.js

index def2002..a5463ea 100644 (file)
@@ -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"); }
index cd13411..2a2da8b 100644 (file)
@@ -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) {
index 5ca64ea..c400664 100644 (file)
@@ -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()));
        }