Author: abelevich
Date: 2007-11-09 10:38:06 -0500 (Fri, 09 Nov 2007)
New Revision: 3868
Modified:
trunk/ui/panelbar/src/main/config/component/panelbar.xml
trunk/ui/panelbar/src/main/java/org/richfaces/renderkit/html/PanelBarRendererBase.java
trunk/ui/panelbar/src/main/resources/org/richfaces/renderkit/html/scripts/panelbar.js
Log:
add mousemove mouseout mouseover client events to the panelBar component
Modified: trunk/ui/panelbar/src/main/config/component/panelbar.xml
===================================================================
--- trunk/ui/panelbar/src/main/config/component/panelbar.xml 2007-11-09 15:34:22 UTC (rev
3867)
+++ trunk/ui/panelbar/src/main/config/component/panelbar.xml 2007-11-09 15:38:06 UTC (rev
3868)
@@ -126,6 +126,30 @@
</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
+ <property>
+ <name>mouseover</name>
+ <classname>java.lang.String</classname>
+ <description>
+ Event must occurs on than item has been changed
+ </description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>mouseout</name>
+ <classname>java.lang.String</classname>
+ <description>
+ Event must occurs on than item has been changed
+ </description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>mousemove</name>
+ <classname>java.lang.String</classname>
+ <description>
+ Event must occurs on than item has been changed
+ </description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
&ui_component_attributes;
Modified:
trunk/ui/panelbar/src/main/java/org/richfaces/renderkit/html/PanelBarRendererBase.java
===================================================================
---
trunk/ui/panelbar/src/main/java/org/richfaces/renderkit/html/PanelBarRendererBase.java 2007-11-09
15:34:22 UTC (rev 3867)
+++
trunk/ui/panelbar/src/main/java/org/richfaces/renderkit/html/PanelBarRendererBase.java 2007-11-09
15:38:06 UTC (rev 3868)
@@ -146,6 +146,9 @@
ScriptOptions options = new ScriptOptions(component);
options.addOption("onitemchange",panelBar.getAttributes().get("onitemchange"));
options.addOption("onclick",
panelBar.getAttributes().get("onclick"));
+ options.addOption("mouseouver",
panelBar.getAttributes().get("mouseouver"));
+ options.addOption("mouseout",
panelBar.getAttributes().get("mouseout"));
+ options.addOption("mousemove",
panelBar.getAttributes().get("mousemove"));
StringBuffer script = new StringBuffer();
JSFunction function = new JSFunction("new Richfaces.PanelBar");
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 2007-11-09
15:34:22 UTC (rev 3867)
+++
trunk/ui/panelbar/src/main/resources/org/richfaces/renderkit/html/scripts/panelbar.js 2007-11-09
15:38:06 UTC (rev 3868)
@@ -20,8 +20,6 @@
this.slides=new Array();
this.ch=this.panel.clientHeight;
this.options = options;
-
- this.onclick = options.onclick;
this.onitemchange = options.onitemchange;
this._attachBehaviors();
@@ -29,9 +27,25 @@
this.defaultIndex=this.findPanelById($F(panelId+"_panelBarInput"));
Event.observe(window,'load',this.handleOnLoad.bindAsEventListener(this));
+
+ this.mouseover = options.mouseover;
+ this.mouseout = options.mouseout;
+ this.mousemove = options.mousemove;
+
+ if (this.mouseover && this.mouseover != ""){
+ Event.observe(this.panel,'mouseover',new Function("event",
"return " + this.mouseout + ";").bindAsEventListener(this));
+ }
+
+ if (this.mouseout && this.mouseout != ""){
+ Event.observe(this.panel,'mouseout',new Function("event",
"return " + this.mouseout + ";").bindAsEventListener(this));
+ }
+
+ if (this.mousemove && this.mousemove != ""){
+ Event.observe(this.panel,'mousemove',new Function("event",
"return " + this.mouseout + ";").bindAsEventListener(this));
+ }
+
+ this.showSlide(this.slides[this.defaultIndex]);
- this.showSlide(this.slides[this.defaultIndex]);
-
this.contentHight = -1;
},
@@ -109,7 +123,7 @@
var rows=this._getDirectChildrenByTag(this.panel,'DIV');
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));
//ndex
+ this.slides.push(new
Richfaces.PanelBar.Slide(this,rows[i],subrows[0],subrows[1],subrows[2],i,this.onclick));
//index
}
},
@@ -135,7 +149,6 @@
return 0;
}
-
}
Richfaces.PanelBar.Slide = Class.create();
@@ -149,6 +162,8 @@
this.header=header;
this.header_act=header_act;
this.content=content;
+ this.onclick = onclick;
+
// this.item.style.overflow="hidden";
// this.header.style.overflowX="hidden";
// this.header.style.overflowY="visible";
@@ -162,7 +177,7 @@
this.content.style.height="0px";
// this.content.style.paddingRight="0px";
this.hightFirefoxDelta = 0;
-
+
if (this.slidePanel.isIE){
if (this.slidePanel.panel.style.width.indexOf("%")!=-1) {
this.item.style.width="100%";
@@ -171,8 +186,8 @@
}
}
- if (onclick && onclick != ""){
- this.onclickFunction = new Function("return " + onclick +
";").bindAsEventListener(this);
+ if (this.onclick && this.onclick != ""){
+ this.onclickFunction = new Function("return " + this.onclick +
";").bindAsEventListener(this);
}
},