From b5f4c1ac40f95d6e786f82d0de221afcc5b5467c Mon Sep 17 00:00:00 2001 From: erickson Date: Mon, 14 Nov 2005 17:03:36 +0000 Subject: [PATCH] no longer using dtree offloading the org tree building until user elects to change locations (built dynamically) added helpful note to org tree selecter page git-svn-id: svn://svn.open-ils.org/ILS/trunk@2020 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/opac/common/js/init.js | 2 +- Open-ILS/web/opac/common/js/opac_utils.js | 5 ++++- Open-ILS/web/opac/locale/en-US/lang.dtd | 6 +++++ .../web/opac/skin/default/js/result_common.js | 2 ++ .../web/opac/skin/default/js/search_bar.js | 11 +++++++++- Open-ILS/web/opac/skin/default/js/sidebar.js | 10 +++++++++ Open-ILS/web/opac/skin/default/xml/index.xml | 1 - .../web/opac/skin/default/xml/js_common.xml | 1 - .../web/opac/skin/default/xml/orgtree.xml | 22 ++++++++++++++++--- .../opac/skin/default/xml/result_common.xml | 2 ++ 10 files changed, 54 insertions(+), 8 deletions(-) diff --git a/Open-ILS/web/opac/common/js/init.js b/Open-ILS/web/opac/common/js/init.js index 3be3658e19..0c3055aec9 100644 --- a/Open-ILS/web/opac/common/js/init.js +++ b/Open-ILS/web/opac/common/js/init.js @@ -6,7 +6,7 @@ window.onunload = windowUnload; attachEvt("common", "init", loadUIObjects); attachEvt("common", "init", initParams); attachEvt("common", "init", initCookies); -attachEvt("common", "init", drawOrgTree); +//attachEvt("common", "init", drawOrgTree); attachEvt("common", "unload", _tree_killer); try{ attachEvt("common", "unload", cleanRemoteRequests);} catch(e){} diff --git a/Open-ILS/web/opac/common/js/opac_utils.js b/Open-ILS/web/opac/common/js/opac_utils.js index 8c823d0a34..629c69e17e 100644 --- a/Open-ILS/web/opac/common/js/opac_utils.js +++ b/Open-ILS/web/opac/common/js/opac_utils.js @@ -416,7 +416,8 @@ function unHideMe(obj) { removeCSSClass(obj, config.css.hide_me); } /* ----------------------------------------------------------------------- */ function drawOrgTree() { //G.ui.common.org_tree.innerHTML = buildOrgSelector().toString(); - buildOrgSelector(G.ui.common.org_tree, orgTreeSelector); + //buildOrgSelector(G.ui.common.org_tree, orgTreeSelector); + setTimeout( 'buildOrgSelector(G.ui.common.org_tree, orgTreeSelector);', 10 ); } var orgTreeSelector; @@ -435,6 +436,8 @@ function buildOrgSelector(node) { "javascript:orgSelect(" + node.id() + ");", node.name()); } } + hideMe($('org_loading_div')); + unHideMe($('org_selector_tip')); return tree; } diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index 56d91e153a..d38ad8b4c2 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -31,6 +31,12 @@ + + + + + + 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 6eea11de08..2c655198cb 100644 --- a/Open-ILS/web/opac/skin/default/js/result_common.js +++ b/Open-ILS/web/opac/skin/default/js/result_common.js @@ -157,7 +157,9 @@ function resultDisplayRecord(rec, pos, is_mr) { if(resultPageIsDone()) { /* hide the 'now loading...' message */ + /* hideMe(G.ui.common.loading); + */ runEvt('result', 'allRecordsReceived', recordsCache); } } diff --git a/Open-ILS/web/opac/skin/default/js/search_bar.js b/Open-ILS/web/opac/skin/default/js/search_bar.js index 4dfd061b53..6533496a05 100644 --- a/Open-ILS/web/opac/skin/default/js/search_bar.js +++ b/Open-ILS/web/opac/skin/default/js/search_bar.js @@ -45,12 +45,20 @@ function searchBarInit() { } +var orgTreeIsBuilt = false; function _opacHandleLocationTagClick() { /* orgTreeSelector.openTo( (newSearchLocation != null) ? parseInt(newSearchLocation) : getLocation(), true ); */ swapCanvas(G.ui.common.org_container); + + if(!orgTreeIsBuilt) { + drawOrgTree(); + orgTreeIsBuilt = true; + //hideMe($('org_loading_div')); + } + } function depthSelectorChanged() { @@ -78,7 +86,8 @@ function buildLocationSelector(newLoc) { var selector = G.ui.searchbar.depth_selector if(!chooseAnotherNode) - chooseAnotherNode = selector.removeChild(selector.getElementsByTagName("option")[0]); + chooseAnotherNode = selector.removeChild( + selector.getElementsByTagName("option")[0]); var node = chooseAnotherNode; removeChildren(selector); diff --git a/Open-ILS/web/opac/skin/default/js/sidebar.js b/Open-ILS/web/opac/skin/default/js/sidebar.js index dcb99aa7a9..3011a953f4 100644 --- a/Open-ILS/web/opac/skin/default/js/sidebar.js +++ b/Open-ILS/web/opac/skin/default/js/sidebar.js @@ -4,6 +4,8 @@ attachEvt("common", "init", initSideBar); attachEvt("common", "init", setSidebarLinks); +attachEvt("common", "unload", sidebarTreesFree ); + function initSideBar() { var page = findCurrentPage(); @@ -78,4 +80,12 @@ function setSidebarLinks() { G.ui.sidebar.myopac_link.setAttribute("href", buildOPACLink({page:MYOPAC}, false, true)); } +function sidebarTreesFree() { + removeChildren($(subjectSidebarTree.rootid)); + removeChildren($(authorSidebarTree.rootid)); + removeChildren($(seriesSidebarTree.rootid)); + subjectSidebarTree = null; + authorSidebarTree = null; + seriesSidebarTree = null; +} diff --git a/Open-ILS/web/opac/skin/default/xml/index.xml b/Open-ILS/web/opac/skin/default/xml/index.xml index 80a8e556a9..a2846cdce2 100644 --- a/Open-ILS/web/opac/skin/default/xml/index.xml +++ b/Open-ILS/web/opac/skin/default/xml/index.xml @@ -12,7 +12,6 @@ - diff --git a/Open-ILS/web/opac/skin/default/xml/js_common.xml b/Open-ILS/web/opac/skin/default/xml/js_common.xml index 15f99e9430..db440ded66 100644 --- a/Open-ILS/web/opac/skin/default/xml/js_common.xml +++ b/Open-ILS/web/opac/skin/default/xml/js_common.xml @@ -11,7 +11,6 @@ - diff --git a/Open-ILS/web/opac/skin/default/xml/orgtree.xml b/Open-ILS/web/opac/skin/default/xml/orgtree.xml index fc4e2cc4eb..251d820cc9 100644 --- a/Open-ILS/web/opac/skin/default/xml/orgtree.xml +++ b/Open-ILS/web/opac/skin/default/xml/orgtree.xml @@ -2,11 +2,27 @@
+ + +

&common.org.loading;
+
+
&common.org.note; + &common.org.notetext; +
+

diff --git a/Open-ILS/web/opac/skin/default/xml/result_common.xml b/Open-ILS/web/opac/skin/default/xml/result_common.xml index 944c32a571..4b80fed382 100644 --- a/Open-ILS/web/opac/skin/default/xml/result_common.xml +++ b/Open-ILS/web/opac/skin/default/xml/result_common.xml @@ -29,7 +29,9 @@ config.names.result.count_cell = "copy_count_cell"; + -- 2.43.2