Author:   Lars Michelsen <[email protected]>
Date:     Sat Jul 23 19:10:13 2011 +0200
Committer:   Lars Michelsen <[email protected]>
Commit-Date: Sat Jul 23 19:10:13 2011 +0200

Revert "Minor code cleanups of old delay code in header menus"

This code was needed to prevent closing the main menu when opening
submenus.

This reverts commit 0595aa17ae129320ac140d269c407f2a627b8f34.

---

 share/userfiles/templates/default.header.js |   30 +++++++++++++++++++-------
 1 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/share/userfiles/templates/default.header.js 
b/share/userfiles/templates/default.header.js
index ee80ef6..f23d953 100644
--- a/share/userfiles/templates/default.header.js
+++ b/share/userfiles/templates/default.header.js
@@ -69,8 +69,21 @@ function headerToggle(store) {
 
 // Hide the given menus instant
 function ddMenuHide(aIds) {
-    for(var i = 0; i < aIds.length; i++)
-        document.getElementById(aIds[i]+ '-ddcontent').style.display = "none";
+    var h;
+    var c;
+    for(var i = 0; i < aIds.length; i++) {
+        h = document.getElementById(aIds[i] + '-ddheader');
+        c = document.getElementById(aIds[i] + '-ddcontent');
+
+        clearTimeout(h.timer);
+        var id = aIds[i];
+        h.timer = window.setTimeout(function () {
+            document.getElementById(id + '-ddcontent').style.display = "none";
+        }, 50);
+    }
+
+    c = null;
+    h = null;
     return false;
 }
 
@@ -79,6 +92,8 @@ function ddMenu(id, d, reposition){
     var h = document.getElementById(id + '-ddheader');
     var c = document.getElementById(id + '-ddcontent');
 
+    clearTimeout(h.timer);
+
     // Reposition by trigger object when some given (used on submenus)
     if(typeof reposition !== 'undefined' && d == 1) {
         c.style.display = 'block';
@@ -87,13 +102,12 @@ function ddMenu(id, d, reposition){
         c.style.top = h.offsetTop + "px";
     }
 
-    if(d == 1)
+    //clearInterval(c.timer);
+    if(d == 1) {
         c.style.display = 'block';
-    else
+    } else {
         c.style.display = 'none';
-
-    c = null;
-    h = null;
+    }
     return false;
 }
 
@@ -243,4 +257,4 @@ function getListNodeIndex(oList) {
 
 function sidebarGetListByTitle(title) {
     return title.parentNode.getElementsByTagName('ul')[0];
-}
+}
\ No newline at end of file


------------------------------------------------------------------------------
Storage Efficiency Calculator
This modeling tool is based on patent-pending intellectual property that
has been used successfully in hundreds of IBM storage optimization engage-
ments, worldwide.  Store less, Store more with what you own, Move data to 
the right place. Try It Now! http://www.accelacomm.com/jaw/sfnl/114/51427378/
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to