Author: vbaranov
Date: 2008-03-18 10:17:15 -0400 (Tue, 18 Mar 2008)
New Revision: 6906
Modified:
branches/3.1.x/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
branches/3.1.x/ui/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx
Log:
http://jira.jboss.com/jira/browse/RF-2548
Modified:
branches/3.1.x/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
===================================================================
---
branches/3.1.x/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2008-03-18
14:11:28 UTC (rev 6905)
+++
branches/3.1.x/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2008-03-18
14:17:15 UTC (rev 6906)
@@ -984,7 +984,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);
@@ -1030,30 +1030,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:
branches/3.1.x/ui/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx
===================================================================
---
branches/3.1.x/ui/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx 2008-03-18
14:11:28 UTC (rev 6905)
+++
branches/3.1.x/ui/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx 2008-03-18
14:17:15 UTC (rev 6906)
@@ -47,7 +47,7 @@
<div id="#{clientId}"
class="dr-menu-item dr-menu-item-enabled rich-menu-item rich-menu-item-enabled
#{component.attributes['styleClass']}"
style="#{component.attributes['style']}"
- onclick="#{component.attributes['onselect']}; #{onclick};
Event.stop(event);"
+ onclick="#{component.attributes['onselect']}; #{onclick};"
onmouseup="Event.stop(event); #{component.attributes['onmouseup']}"
>
<f:call name="utils.encodeAttributes">
<f:parameter value="onmousedown,onmousemove" />