]> err.no Git - scalable-opengroupware.org/blobdiff - UI/WebServerResources/generic.js
git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1163 d1b88da0-ebda-0310...
[scalable-opengroupware.org] / UI / WebServerResources / generic.js
index 0e5d7587fd1e7a9dd98085fab32f1d81a5348756..608947f61cb78ce1e820adfce37f1e5a6d76d4d0 100644 (file)
@@ -309,19 +309,27 @@ function triggerAjaxRequest(url, callback, userdata) {
   return http;
 }
 
+function startAnimation(parent, nextNode) {
+  var anim = document.createElement("img");
+  anim = $(anim);
+  anim.id = "progressIndicator";
+  anim.src = ResourcesURL + "/busy.gif";
+  anim.setStyle({ visibility: "hidden" });
+  if (nextNode)
+    parent.insertBefore(anim, nextNode);
+  else
+    parent.appendChild(anim);
+  anim.setStyle({ visibility: "visible" });
+
+  return anim;
+}
+
 function checkAjaxRequestsState() {
   var toolbar = document.getElementById("toolbar");
   if (toolbar) {
     if (activeAjaxRequests > 0
         && !document.busyAnim) {
-      var anim = document.createElement("img");
-      anim = $(anim);
-      document.busyAnim = anim;
-      anim.id = "progressIndicator";
-      anim.src = ResourcesURL + "/busy.gif";
-      anim.setStyle({ visibility: "hidden" });
-      toolbar.appendChild(anim);
-      anim.setStyle({ visibility: "visible" });
+      document.busyAnim = startAnimation(toolbar);
     }
     else if (activeAjaxRequests == 0
             && document.busyAnim
@@ -1252,7 +1260,9 @@ function loadPreferences() {
 }
 
 function onLoadHandler(event) {
-   loadPreferences();
+   if (!document.body.hasClassName("loginPage")) {
+     loadPreferences();
+   }
    queryParameters = parseQueryParameters('' + window.location);
    if (!$(document.body).hasClassName("popup")) {
       initLogConsole();
@@ -1304,14 +1314,14 @@ function configureLinkBanner() {
   var linkBanner = $("linkBanner");
   if (linkBanner) {
     var anchors = linkBanner.childNodesWithTag("a");
-    for (var i = 0; i < 2; i++) {
+    for (var i = 1; i < 3; i++) {
        Event.observe(anchors[i], "mousedown", listRowMouseDownHandler);
        Event.observe(anchors[i], "click", onLinkBannerClick);
     }
-    Event.observe(anchors[3], "mousedown", listRowMouseDownHandler);
-    Event.observe(anchors[3], "click", onPreferencesClick);
-    if (anchors.length > 4)
-       Event.observe(anchors[4], "click", toggleLogConsole);
+    Event.observe(anchors[4], "mousedown", listRowMouseDownHandler);
+    Event.observe(anchors[4], "click", onPreferencesClick);
+    if (anchors.length > 5)
+       Event.observe(anchors[5], "click", toggleLogConsole);
   }
 }