[richfaces-svn-commits] JBoss Rich Faces SVN: r250 - 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
Tue Apr 3 10:15:41 EDT 2007


Author: a.izobov
Date: 2007-04-03 10:15:41 -0400 (Tue, 03 Apr 2007)
New Revision: 250

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

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-03 14:14:48 UTC (rev 249)
+++ trunk/richfaces/dropdown-menu/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js	2007-04-03 14:15:41 UTC (rev 250)
@@ -710,8 +710,8 @@
    		//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();
 
-
 	},
 	closeSiblings: function(e){
 		//LOG.a4j_debug('closeASiblins ' + this.id +' ' +this.level);
@@ -784,7 +784,7 @@
 		Exadel.Menu.Layers.clearPopUpTO();
 		Exadel.Menu.Layers.levels[this.level] = null;
 		Exadel.Menu.Layers.LMPopUpL(this.id, false);
-
+		if (this.eventOnClose) this.eventOnClose();
 	},
 	asDropDown: function(topLevel, onEvt, offEvt, options){
 		this.options = options || {};
@@ -826,6 +826,13 @@
 	},
 	asSubMenu: function(parent, refLayerName, evtName, options){
 		this.options = options || {};
+		if (this.options.onclose != ""){
+			this.eventOnClose = new Function("event",this.options.onclose).bindAsEventListener(this);
+		}
+		if (this.options.onopen != ""){
+			this.eventOnOpen = new Function("event",this.options.onopen).bindAsEventListener(this);
+		}
+		
 		if(!evtName){
 			evtName = 'onmouseover';
 		}




More information about the richfaces-svn-commits mailing list