Author: vbaranov
Date: 2008-03-14 07:49:30 -0400 (Fri, 14 Mar 2008)
New Revision: 6805
Modified:
trunk/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx
Log:
http://jira.jboss.com/jira/browse/RF-2102
Modified:
trunk/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
===================================================================
---
trunk/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2008-03-14
11:49:23 UTC (rev 6804)
+++
trunk/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2008-03-14
11:49:30 UTC (rev 6805)
@@ -971,7 +971,7 @@
RichFaces.Menu.Layers.LMPopUpL(this.id, false);
// if (this.eventOnClose) this.eventOnClose();
},
- asDropDown: function(topLevel, onEvt, offEvt, options){
+ asDropDown: function(topLevel, bindElementId, onEvt, offEvt, options){
this.options = options || {};
if (this.options.ongroupactivate){
this.eventOnGroupActivate = this.options.ongroupactivate.bindAsEventListener(this);
@@ -1017,30 +1017,30 @@
}
offEvt = this.eventJsToPrototype(offEvt);
- var addBinding = function(eventName, handler) {
- var binding = new RichFaces.Menu.Layer.Binding(topLevel, eventName, handler);
+ var addBinding = function(elementId, eventName, handler) {
+ var binding = new RichFaces.Menu.Layer.Binding(elementId, eventName, handler);
this.bindings.push(binding);
binding.refresh();
}.bind(this);
if (onEvt == 'mouseover') {
- addBinding(onEvt, function(e) {
+ addBinding(topLevel, onEvt, function(e) {
menuOn.call(this, e);
mouseover.call(this, e);
}.bindAsEventListener(this));
} else {
- addBinding(onEvt, menuOn.bindAsEventListener(this));
- addBinding('mouseover', mouseover.bindAsEventListener(this));
+ addBinding(bindElementId, onEvt, menuOn.bindAsEventListener(this));
+ addBinding(topLevel, 'mouseover', mouseover.bindAsEventListener(this));
}
if (offEvt == 'mouseout') {
- addBinding(offEvt, function(e) {
+ addBinding(topLevel, offEvt, function(e) {
menuOff.call(this, e);
mouseout.call(this, e);
}.bindAsEventListener(this));
} else {
- addBinding(offEvt, menuOff.bindAsEventListener(this));
- addBinding('mouseout', mouseout.bindAsEventListener(this));
+ addBinding(bindElementId, offEvt, menuOff.bindAsEventListener(this));
+ addBinding(topLevel, 'mouseout', mouseout.bindAsEventListener(this));
}
RichFaces.Menu.Layers.horizontals[this.id] = topLevel;
Modified: trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx
===================================================================
--- trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx 2008-03-14
11:49:23 UTC (rev 6804)
+++ trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx 2008-03-14
11:49:30 UTC (rev 6805)
@@ -67,7 +67,7 @@
$('#{clientId}:icon').className='dr-menu-icon dr-menu-icon-selected
rich-menu-item-icon rich-menu-item-icon-selected
#{component.attributes['iconClass']}';
Element.addClassName($('#{clientId}:anchor'),
'rich-menu-item-label-selected');"
style="#{menuItemStyle}"
- onclick="this.className='dr-menu-item dr-menu-item-enabled rich-menu-item
rich-menu-item-enabled #{component.attributes['styleClass']}'; #{onselect}
#{onclick}; Event.stop(event);"
+ onclick="this.className='dr-menu-item dr-menu-item-enabled rich-menu-item
rich-menu-item-enabled #{component.attributes['styleClass']}'; #{onselect}
#{onclick};"
onmouseup="Event.stop(event);
#{component.attributes['onmouseup']}">
<f:call name="utils.encodeAttributes">
<f:parameter value="onmousedown,onmousemove" />