[richfaces-svn-commits] JBoss Rich Faces SVN: r5537 - trunk/ui/panelbar/src/main/resources/org/richfaces/renderkit/html/scripts.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Tue Jan 22 11:49:45 EST 2008


Author: akushunin
Date: 2008-01-22 11:49:45 -0500 (Tue, 22 Jan 2008)
New Revision: 5537

Modified:
   trunk/ui/panelbar/src/main/resources/org/richfaces/renderkit/html/scripts/panelbar.js
Log:
http://jira.jboss.com/jira/browse/RF-1916

Modified: trunk/ui/panelbar/src/main/resources/org/richfaces/renderkit/html/scripts/panelbar.js
===================================================================
--- trunk/ui/panelbar/src/main/resources/org/richfaces/renderkit/html/scripts/panelbar.js	2008-01-22 16:45:13 UTC (rev 5536)
+++ trunk/ui/panelbar/src/main/resources/org/richfaces/renderkit/html/scripts/panelbar.js	2008-01-22 16:49:45 UTC (rev 5537)
@@ -22,6 +22,7 @@
 		this.options = options;
         this.onitemchange = options.onitemchange;
         this.onclick = options.onclick;
+        this.items = options.items;
         
         this._attachBehaviors();
 
@@ -32,8 +33,8 @@
 		
 		this.mouseover = options.mouseover;
 		this.mouseout = options.mouseout;
-		this.mousemove = options.mousemove;
-		this.items = options.items;
+		this.mousemove = options.mousemove;		
+		
 			
 		if (this.mouseover && this.mouseover != ""){
 			Event.observe(this.panel,'mouseover',new Function("event",this.mouseover));
@@ -108,14 +109,31 @@
 	},
 	
 	_attachBehaviors: function() {
-		var rows=this._getDirectChildrenByTag(this.panel,'DIV');
+		var rows=this._getItems(this.panel);
 		for(var i=0; i<rows.length; i++) {
 			var subrows=this._getDirectChildrenByTag(rows[i],'DIV');
 			this.slides.push(new Richfaces.PanelBar.Slide(this,rows[i],subrows[0],subrows[1],subrows[2],i,this.onclick)); //index
 		}
 	},
+	_getItems: function( e ) {
 
+		var kids = new Array();
+		var item = e.firstChild;
+		var index=0;
+		var id = this.items[index].id;
+		do
+		{
+			if (item.id == id)
+			{
+				kids.push(item);
+				index++;
+				if (index<this.items.length) id = this.items[index].id; else break;
+			}
+		} while (item=item.nextSibling)
+		return kids;
 
+	},
+
 	_getDirectChildrenByTag: function( e, tagName ) {
 
 		var kids = new Array();




More information about the richfaces-svn-commits mailing list