]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/web/opac/common/js/init.js
fixed (mostly) the location and depth handling in the SC opac
[Evergreen.git] / Open-ILS / web / opac / common / js / init.js
1
2 /* these events should be used by all */
3
4 window.onunload = windowUnload;
5
6 attachEvt("common", "init", loadUIObjects);
7 attachEvt("common", "init", initParams);
8 attachEvt("common", "init", initCookies);
9
10 attachEvt("common", "unload", _tree_killer);
11 try{ attachEvt("common", "unload", cleanRemoteRequests);} catch(e){}
12
13 function init() {
14
15
16         runEvt('common','init');
17         if( getOrigLocation() == 0 ) ORIGLOC = LOCATION;
18
19         var cgi = new CGI();
20         if( grabUser() ) {
21                 if( cgi.param(PARAM_LOCATION) == null ) {
22                         LOCATION = G.user.ws_ou();
23                         DEPTH = findOrgDepth(G.user.ws_ou());
24                 }
25         }
26
27         runEvt("common", "run");
28         //checkUserSkin();
29         G.ui.common.now_searching.appendChild(text(findOrgUnit(getLocation()).name()));
30 }
31
32 function windowUnload() { runEvt("common", "unload"); }