Author: abelevich
Date: 2007-11-21 11:00:09 -0500 (Wed, 21 Nov 2007)
New Revision: 4140
Modified:
trunk/ui/simpleTogglePanel/src/main/java/org/richfaces/renderkit/html/SimpleTogglePanelRenderer.java
trunk/ui/simpleTogglePanel/src/main/resources/org/richfaces/renderkit/html/scripts/simpleTogglePanel.js
Log:
Modified:
trunk/ui/simpleTogglePanel/src/main/java/org/richfaces/renderkit/html/SimpleTogglePanelRenderer.java
===================================================================
---
trunk/ui/simpleTogglePanel/src/main/java/org/richfaces/renderkit/html/SimpleTogglePanelRenderer.java 2007-11-21
15:13:01 UTC (rev 4139)
+++
trunk/ui/simpleTogglePanel/src/main/java/org/richfaces/renderkit/html/SimpleTogglePanelRenderer.java 2007-11-21
16:00:09 UTC (rev 4140)
@@ -155,15 +155,7 @@
JSReference eventRef = new JSReference("event");
String panelId = tgComp.getClientId(context);
- //String userOnClick =
(String)component.getAttributes().get("onclick");
- //if(userOnClick!=null) {
- // onClick.append(userOnClick);
- // if(!userOnClick.trim().endsWith(";")) {
- // onClick.append("; ");
- // }
- //}
-
- if (UISimpleTogglePanel.CLIENT_SWITCH_TYPE.equals(switchType)) {
+ if (UISimpleTogglePanel.CLIENT_SWITCH_TYPE.equals(switchType)) {
// Client
JSFunction function = new
JSFunction("SimpleTogglePanelManager.toggleOnClient");
function.addParameter(eventRef);
Modified:
trunk/ui/simpleTogglePanel/src/main/resources/org/richfaces/renderkit/html/scripts/simpleTogglePanel.js
===================================================================
---
trunk/ui/simpleTogglePanel/src/main/resources/org/richfaces/renderkit/html/scripts/simpleTogglePanel.js 2007-11-21
15:13:01 UTC (rev 4139)
+++
trunk/ui/simpleTogglePanel/src/main/resources/org/richfaces/renderkit/html/scripts/simpleTogglePanel.js 2007-11-21
16:00:09 UTC (rev 4140)
@@ -35,7 +35,7 @@
var switch_on = $(this.panelId+"_switch_on");
var switch_off = $(this.panelId+"_switch_off");
if (this.status=="false"){
- if (this.invokeEvent("expand",event,this.status,body)) {
+ if (this.invokeEvent("expand",event,"false",body)) {
Element.show(body);
this.status="true";
switch_off.style.display="none";
@@ -43,7 +43,7 @@
}
// this.timer = setTimeout(this.windowOnLoad.bind(this), 100);
// body.firstChild.style.width=body.clientWidth;
- } else if (this.invokeEvent("collapse",event,this.status,body)) {
+ } else if (this.invokeEvent("collapse",event,"true",body)) {
Element.hide(body);
body.firstChild.style.width="100%";
this.status="false";
@@ -122,12 +122,12 @@
}
if (this.panels[clientId].status == "true") {
- if (this.panels[clientId].invokeEvent("collapse",event,fInput.value,fInput))
{
+ if
(this.panels[clientId].invokeEvent("collapse",event,"true",fInput)) {
this.panels[clientId].status="false";
}
} else {
- if (this.panels[clientId].invokeEvent("expand",event,fInput.value,fInput)) {
+ if
(this.panels[clientId].invokeEvent("expand",event,"false",fInput)) {
this.panels[clientId].status="true";
}
}
@@ -143,14 +143,12 @@
}
SimpleTogglePanelManager.toggleOnAjax = function(event,panelId) {
+ var element = $(panelId);
+
if (this.panels[panelId].status == "true") {
- if(this.panels[panelId].options.oncollapse){
- //this.panels[panelId].onCollapseEvent(event);
- }
+ return
this.panels[panelId].invokeEvent("collapse",event,"true",element);
} else {
- if (this.panels[panelId].options.onexpand) {
- //this.panels[panelId].onExpandEvent(event);
- }
+ return
this.panels[panelId].invokeEvent("expand",event,"false",element);
}
}