Author: dbiatenia
Date: 2007-06-09 06:54:15 -0400 (Sat, 09 Jun 2007)
New Revision: 1113
Modified:
trunk/sandbox/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js
trunk/sandbox/panelmenu/src/main/templates/org/richfaces/htmlPanelMenu.jspx
trunk/sandbox/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuGroup.jspx
trunk/sandbox/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuItem.jspx
Log:
Modified:
trunk/sandbox/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js
===================================================================
---
trunk/sandbox/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js 2007-06-09
10:49:38 UTC (rev 1112)
+++
trunk/sandbox/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js 2007-06-09
10:54:15 UTC (rev 1113)
@@ -58,6 +58,9 @@
parent = parent.parentObj;
}
this.obj = $(ids.myId);
+ this.leftIcon = $('leftIcon' + ids.myId);
+ this.rightIcon = $('rightIcon' + ids.myId);
+ this.labelArea = $('icon' + ids.myId);
this.content = this._getDirectChildrenByTag(this.obj,"TD")[level+1];
this.iconAlign = iconAlign;
/*
@@ -288,8 +291,13 @@
Element.setStyle(this.obj, this.hoveredStyles);
}
if (this.hoveredClasses)
- for (i = 0; i < this.hoveredClasses.length; i++)
+ for (i = 0; i < this.hoveredClasses.length; i++) {
this.obj.addClassName(this.hoveredClasses[i]);
+ this.leftIcon.addClassName(this.hoveredClasses[i]);
+ this.rightIcon.addClassName(this.hoveredClasses[i]);
+ this.labelArea.addClassName(this.hoveredClasses[i]);
+ }
+
},
removeHoverStyles: function(e) {
@@ -298,8 +306,13 @@
}
if (this.hoveredClasses)
- for (var i = 0; i < this.hoveredClasses.length; i++)
+ for (var i = 0; i < this.hoveredClasses.length; i++){
this.obj.removeClassName(this.hoveredClasses[i]);
+ this.leftIcon.removeClassName(this.hoveredClasses[i]);
+ this.rightIcon.removeClassName(this.hoveredClasses[i]);
+ this.labelArea.removeClassName(this.hoveredClasses[i]);
+ }
+
},
_getDirectChildrenByTag: function(e, tagName) {
@@ -329,8 +342,16 @@
Event.observe(this.obj, this.event, this.itemClicked.bindAsEventListener(this),
false);
else
Event.observe(this.obj, "click",
this.itemClicked.bindAsEventListener(this), false);
+
Event.observe(this.obj, "mouseover",
this.addHoverStyles.bindAsEventListener(this), false);
Event.observe(this.obj, "mouseout",
this.removeHoverStyles.bindAsEventListener(this), false);
+
+ Event.observe(this.leftIcon, "mouseover",
this.addHoverStyles.bindAsEventListener(this), false);
+ Event.observe(this.rightIcon, "mouseover",
this.addHoverStyles.bindAsEventListener(this), false);
+ Event.observe(this.labelArea, "mouseover",
this.addHoverStyles.bindAsEventListener(this), false);
+ Event.observe(this.leftIcon, "mouseout",
this.removeHoverStyles.bindAsEventListener(this), false);
+ Event.observe(this.rightIcon, "mouseout",
this.removeHoverStyles.bindAsEventListener(this), false);
+ Event.observe(this.labelArea, "mouseout",
this.removeHoverStyles.bindAsEventListener(this), false);
}
}
};
Modified: trunk/sandbox/panelmenu/src/main/templates/org/richfaces/htmlPanelMenu.jspx
===================================================================
--- trunk/sandbox/panelmenu/src/main/templates/org/richfaces/htmlPanelMenu.jspx 2007-06-09
10:49:38 UTC (rev 1112)
+++ trunk/sandbox/panelmenu/src/main/templates/org/richfaces/htmlPanelMenu.jspx 2007-06-09
10:54:15 UTC (rev 1113)
@@ -29,14 +29,11 @@
id="#{clientId}" width="#{component.width}" >
<tbody>
- <vcp:body>
- <!-- TODO by nick - dima - vcp:body content is fully ignored -->
- <f:call name="renderChildren" />
+ <vcp:body>
+ <f:call name="renderChildren"/>
</vcp:body>
<tr style="display:none">
<td>
- <!-- TODO by nick - dima - no need for clientId here -->
- <!--f:clientid var="clientId"/-->
<f:call name="insertScript"/>
</td>
</tr>
Modified:
trunk/sandbox/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuGroup.jspx
===================================================================
---
trunk/sandbox/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuGroup.jspx 2007-06-09
10:49:38 UTC (rev 1112)
+++
trunk/sandbox/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuGroup.jspx 2007-06-09
10:54:15 UTC (rev 1113)
@@ -12,53 +12,38 @@
<f:clientid var="clientId"/>
- <!-- TODO by nick - dima - use #{clientId}tdhide instead of tdhide#{clientId} -->
<tr id="tdhide#{clientId}" style="#{this:getHideStyle(context,
component)}" >
<td>
<jsp:scriptlet>
<![CDATA[
- String itemClass = "";
- if (component.isDisabled() || findMenu(component).isDisabled()) {
- itemClass = " dr-pmenu-disabled-element rich-pmenu-disabled-element ";
- }
- variables.setVariable("itemClass", itemClass);
-
String isNodeOpened = isOpened(context, component) ?
"opened" : "closed";
]]>
</jsp:scriptlet>
<table cellpadding="0" cellspacing="0" border="0"
width="100%"
id="tablehide#{clientId}"
- class="dr-pmenu-group rich-pmenu-group #{this:getFullStyleClass( context,
component )} #{itemClass}"
+ class="dr-pmenu-group rich-pmenu-group #{this:getFullStyleClass( context,
component )} "
style="#{this:getFullStyle( context, component )}" >
- <f:call name="utils.encodeAttributes">
- <f:parameter value="onclick,onmousedown,onmouseup,onmousemove" />
- </f:call>
- <!-- TODO by nick - dima - encodeAttributes & encodePassThru conflict -->
<f:call name="utils.encodePassThru" />
<tr id="#{clientId}">
- <!-- TODO by nick - dima - just id="_#_{clientId}" -->
- <!--f:call name="utils.encodeId" /-->
<f:call name="insertTDs" />
- <td>
+ <td id="leftIcon#{clientId}" class="#{this:getIconClass( context,
component )}">
<f:call name="insertImage">
<f:parameter value="left" />
</f:call>
</td>
- <!-- TODO by nick - dima - item_content should be removed -->
- <td style="width:100%" class="item_content"
- id="icon#{clientId}" >
+ <td style="width:100%" id="icon#{clientId}"
class="#{this:getLabelClass( context, component )}">
<input type="hidden" name="panelMenuState#{clientId}"
value="#{isNodeOpened}" >
</input>
- <!-- TODO by nick - dima - one input should be enough -->
+
<input type="hidden" name="panelMenuAction#{clientId}"
value="" >
</input>
<f:call name="insertLabel"/>
</td>
- <td>
+ <td id="rightIcon#{clientId}" class="#{this:getIconClass( context,
component )}">
<f:call name="insertImage">
<f:parameter value="right" />
</f:call>
@@ -68,7 +53,6 @@
</td>
</tr>
<vcp:body>
- <!-- TODO by nick - dima - vcp:body content is fully ignored -->
<f:call name="renderChildren" />
</vcp:body>
</f:root>
\ No newline at end of file
Modified: trunk/sandbox/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuItem.jspx
===================================================================
---
trunk/sandbox/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuItem.jspx 2007-06-09
10:49:38 UTC (rev 1112)
+++
trunk/sandbox/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuItem.jspx 2007-06-09
10:54:15 UTC (rev 1113)
@@ -14,23 +14,9 @@
<f:clientid var="clientId"/>
<tr id="tdhide#{clientId}" style="#{this:getHideStyle(context,
component)}" >
<td>
- <jsp:scriptlet>
- <![CDATA[
- String itemClass = " dr-pmenu-disabled-element
rich-pmenu-disabled-element ";
- String onClick;
- if (component.isDisabled() || findMenu(component).isDisabled()) {
- variables.setVariable("itemClass", itemClass);
- } else {
- //onClick = component.getAttributes().get("onclick") +
";" + getOnClick(context, component);
- //variables.setVariable("onClick", onClick);
- }
-
- ]]>
- </jsp:scriptlet>
<table cellpadding="0" cellspacing="0" border="0"
width="100%"
- class="rich-pmenu-item dr-pmenu-item #{this:getFullStyleClass( context,
component )} #{itemClass}"
+ class="rich-pmenu-item dr-pmenu-item #{this:getFullStyleClass( context,
component )} "
style="#{this:getFullStyle( context, component )}"
-
id="tablehide#{clientId}" >
<f:call name="utils.encodeAttributes">
<f:parameter value="onclick,onmousedown,onmouseup,onmousemove" />
@@ -38,21 +24,20 @@
<tr>
<f:call name="utils.encodeId"/>
<f:call name="insertTDs"/>
- <td>
+ <td id="leftIcon#{clientId}" class="#{this:getIconClass( context,
component )}">
<f:call name="insertImage">
<f:parameter value="left"/>
</f:call>
</td>
- <td style="width:100%" class="item_content">
- <input type="hidden" name="panelMenuAction#{clientId}"
- value="" >
- </input>
+ <td id="icon#{clientId}" class="#{this:getLabelClass( context,
component )}" style="width:100%">
+ <input type="hidden" name="panelMenuAction#{clientId}"
value=""/>
<f:call name="insertValue"/>
<vcp:body>
<f:call name="renderChildren" />
- </vcp:body>
+ </vcp:body>
+ <f:clientid var="clientId"/>
</td>
- <td>
+ <td id="rightIcon#{clientId}" class="#{this:getIconClass( context,
component )}">
<f:call name="insertImage">
<f:parameter value="right"/>
</f:call>