[richfaces-svn-commits] JBoss Rich Faces SVN: r259 - trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Wed Apr 4 04:00:46 EDT 2007


Author: a.izobov
Date: 2007-04-04 04:00:46 -0400 (Wed, 04 Apr 2007)
New Revision: 259

Modified:
   trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
Log:
event support(onclose, onopen) for menuGroup changed

Modified: trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
===================================================================
--- trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js	2007-04-04 07:33:14 UTC (rev 258)
+++ trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js	2007-04-04 08:00:46 UTC (rev 259)
@@ -95,9 +95,18 @@
 			return;
 		}
 		this.detectWidth();
-		Exadel.Menu.fitLayerToContent($(menuName));
+		var menu = $(menuName);
+		Exadel.Menu.fitLayerToContent(menu);
+		var visible = this.isVisible(menuName);
 		this.setVisibility(menuName, visibleFlag);
 		this.ieSelectWorkAround(menuName, visibleFlag);
+		if (visible && !visibleFlag) {
+			var menuLayer = this.layers[menu.id];
+			if (menuLayer && menuLayer.eventOnClose) menuLayer.eventOnClose();
+		} else if (!visible && visibleFlag) {
+			var menuLayer = this.layers[menu.id];
+			if (menuLayer && menuLayer.eventOnOpen) menuLayer.eventOnOpen();
+		}
 	},
 
 	ieSelectWorkAround: function(menuName, on){
@@ -710,7 +719,7 @@
    		//LOG.a4j_debug('show me ' + this.id +' ' +this.level);
    		Exadel.Menu.Layers.showMenuLayer(this.id, e, this.delay);
    		Exadel.Menu.Layers.levels[this.level] = this;
-		if (this.eventOnOpen) this.eventOnOpen();
+//		if (this.eventOnOpen) this.eventOnOpen();
 
 	},
 	closeSiblings: function(e){
@@ -800,7 +809,7 @@
 		Exadel.Menu.Layers.clearPopUpTO();
 		Exadel.Menu.Layers.levels[this.level] = null;
 		Exadel.Menu.Layers.LMPopUpL(this.id, false);
-		if (this.eventOnClose) this.eventOnClose();
+//		if (this.eventOnClose) this.eventOnClose();
 	},
 	asDropDown: function(topLevel, onEvt, offEvt, options){
 		this.options = options || {};




More information about the richfaces-svn-commits mailing list