Author: jmorliaguet
Date: Tue Jan  3 20:14:00 2006
New Revision: 2132

Modified:
   cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.css
   cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js
Log:

- we register one mouseover event instead of one per submenu

- smaller menu



Modified: cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.css
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.css        
(original)
+++ cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.css        Tue Jan 
 3 20:14:00 2006
@@ -20,7 +20,7 @@
   border-color: #666;
   background-color: #eeeeec;
   color: #000;
-  width: 160px;
+  width: 130px;
 }
 
 .contextMenu a {
@@ -31,7 +31,7 @@
   background-position: 6px center;
   color: #000;
   padding: 4px 5px 4px 29px;
-  width: 126px;
+  width: 96px;
 }
 
 .contextMenu .separator {

Modified: cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js (original)
+++ cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js Tue Jan  3 
20:14:00 2006
@@ -413,8 +413,10 @@
     this.showEvent = this.showEvent.bindAsEventListener(this);
     this.hideEvent = this.hideEvent.bindAsEventListener(this);
     this.callEvent = this.callEvent.bindAsEventListener(this);
+    this.mouseOverEvent = this.mouseOverEvent.bindAsEventListener(this);
     Event.observe(this.widget, "mousedown", function(e) {Event.stop(e)});
     Event.observe(this.widget, "mouseup", this.callEvent);
+    Event.observe(this.widget, "mouseover", this.mouseOverEvent);
     Event.observe(this.area, "mouseup", this.showEvent);
     Event.observe(document, "mousedown", this.hideEvent);
   },
@@ -465,6 +467,21 @@
     }
   },
 
+  mouseOverEvent: function(e) {
+    var here = Event.element(e);
+    if (Element.hasClassName(here, "submenuitem")) {
+      var menu = this._getSubmenu(here);
+      if (!menu) return;
+
+      document.getElementsByClassName("submenu", here.parentNode).each(
+        function(v) {
+          Element.hide(v);
+        }
+      );
+      Element.show(menu);
+    }
+  },
+
   _getSubmenu: function(element) {
     if (!element) return null;
     var nodes = element.childNodes;
@@ -606,26 +623,11 @@
             }
           });
 
-          var mouseOverEvent = function(e) {
-            var here = Event.element(e);
-            var menu = this._getSubmenu(here);
-            if (!menu) return;
-
-            document.getElementsByClassName("submenu", here.parentNode).each(
-              function(v) { Element.hide(v); }
-            );
-            Element.show(menu);
-
-          }.bindAsEventListener(this);
-
-          Event.observe(item, "mouseover", mouseOverEvent);
-
           this._renderFragment(submenu, tag);
 
           break;
         };
       }
-
     }
   }
 
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to