Author: abelevich
Date: 2011-01-25 06:59:09 -0500 (Tue, 25 Jan 2011)
New Revision: 21193
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menu-base.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menu.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menugroup.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menuitem.js
trunk/ui/output/ui/src/main/templates/dropdownmenu.template.xml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_ajaxMode.xmlunit.xml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_serverMode.xmlunit.xml
Log:
https://issues.jboss.org/browse/RF-10235 DropDownMenu: popup is never getting hidden in IE
and Google Chrome
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menu-base.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menu-base.js 2011-01-25
11:16:55 UTC (rev 21192)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menu-base.js 2011-01-25
11:59:09 UTC (rev 21193)
@@ -49,8 +49,7 @@
this.selectedGroup = null;
- rf.Event.bindById(this.id, this.options.showEvent, $.proxy(
- this.__showHandler, this), this);
+
rf.Event.bindById(this.id, "mouseenter", $.proxy(this.__overHandler,
this), this);
rf.Event.bindById(this.id, "mouseleave", $.proxy(this.__leaveHandler,
@@ -114,11 +113,13 @@
},
__hidePopup : function() {
+ window.clearTimeout(this.showTimeoutId);
+ this.showTimeoutId=null;
if (this.__isShown()) {
this.invokeEvent("hide", rf.getDomElement(this.id), null);
this.__closeChildGroups();
this.popup.hide();
- this.displayed = false;
+ this.displayed = false;
this.__deselectCurrentItem();
this.currentSelectedItemIndex = -1;
jqueryParentMenu = this.__getParentMenu();
@@ -195,7 +196,6 @@
__selectItem : function(item) {
if (!rf.$(item).isSelected) {
-
rf.$(item).select();
}
},
@@ -205,14 +205,18 @@
e.currentTarget).eq(0);
},
- __showHandler : function() {
- this.showTimeoutId = window.setTimeout($.proxy(function() {
- this.show();
- }, this), this.options.showDelay);
+ __showHandler : function(e) {
+ if (!this.__isShown()){
+ this.showTimeoutId = window.setTimeout($.proxy(function() {
+ this.show();
+ }, this), this.options.showDelay);
+ }
+
+
},
__leaveHandler : function() {
- window.clearTimeout(this.showTimeoutId);
+ //console.log('__leaveHandler showTimeoutId:'+ this.showTimeoutId);
this.hideTimeoutId = window.setTimeout($.proxy(function() {
this.hide();
}, this), this.options.hideDelay);
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menu.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menu.js 2011-01-25
11:16:55 UTC (rev 21192)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menu.js 2011-01-25
11:59:09 UTC (rev 21193)
@@ -30,7 +30,10 @@
this.namespace = this.namespace || "."
+ rf.Event.createNamespace(this.name, this.id);
this.groupList = new Array();
-
+
+ rf.Event.bindById(this.id+"_label", this.options.showEvent, $.proxy(
+ this.__showHandler, this), this);
+
this.attachToDom(componentId);
if (!rf.ui.MenuManager)
rf.ui.MenuManager = {};
@@ -68,11 +71,11 @@
}
},
- show : function() {
+ show : function(e) {
if (this.menuManager.openedMenu != this.id) {
this.menuManager.shutdownMenu();
this.menuManager.addMenuId(this.id);
- this.__showPopup();
+ this.__showPopup(e);
}
},
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menugroup.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menugroup.js 2011-01-25
11:16:55 UTC (rev 21192)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menugroup.js 2011-01-25
11:59:09 UTC (rev 21193)
@@ -21,7 +21,10 @@
this.namespace = this.namespace || "."
+ rf.Event.createNamespace(this.name, this.id);
this.attachToDom(componentId);
-
+
+ rf.Event.bindById(this.id, this.options.showEvent, $.proxy(
+ this.__showHandler, this), this);
+
this.rootMenu = rf.$(this.options.rootMenuId);
this.shown = false;
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menuitem.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menuitem.js 2011-01-25
11:16:55 UTC (rev 21192)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menuitem.js 2011-01-25
11:59:09 UTC (rev 21193)
@@ -49,7 +49,7 @@
__clickHandler : function (e) {
var parentMenu = this.__getParentMenu();
if (parentMenu) {
- this.__getParentMenu().processItem(this.element);
+ parentMenu.processItem(this.element);
}
this.__submitForm(rf.getDomElement(this.id), e, this.options.params);
Modified: trunk/ui/output/ui/src/main/templates/dropdownmenu.template.xml
===================================================================
--- trunk/ui/output/ui/src/main/templates/dropdownmenu.template.xml 2011-01-25 11:16:55
UTC (rev 21192)
+++ trunk/ui/output/ui/src/main/templates/dropdownmenu.template.xml 2011-01-25 11:59:09
UTC (rev 21193)
@@ -23,7 +23,7 @@
<div id="#{clientId}" class="rf-ddm-lbl #{isDisabled ?
'rf-ddm-lbl-dis' : 'rf-ddm-lbl-unsel '+styleClass} "
style="#{style}"
cdk:passThroughWithExclusions="">
- <div class="#{isDisabled ? 'rf-ddm-lbl-dis' :
'rf-ddm-lbl-dec'}">
+ <div id="#{clientId}_label" class="#{isDisabled ?
'rf-ddm-lbl-dis' : 'rf-ddm-lbl-dec'}">
<c:choose>
<c:when test="#{label != null and label.isRendered()}">
Modified:
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_ajaxMode.xmlunit.xml
===================================================================
---
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_ajaxMode.xmlunit.xml 2011-01-25
11:16:55 UTC (rev 21192)
+++
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_ajaxMode.xmlunit.xml 2011-01-25
11:59:09 UTC (rev 21193)
@@ -1,5 +1,5 @@
<div class="rf-ddm-lbl rf-ddm-lbl-unsel "
id="form:ddmenu">
- <div class="rf-ddm-lbl-dec">
+ <div id="form:ddmenu_label" class="rf-ddm-lbl-dec">
<img src="/images/ddmenu/copy.gif" class="pic"/>
File
</div>
Modified:
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_serverMode.xmlunit.xml
===================================================================
---
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_serverMode.xmlunit.xml 2011-01-25
11:16:55 UTC (rev 21192)
+++
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/dropDownMenu_serverMode.xmlunit.xml 2011-01-25
11:59:09 UTC (rev 21193)
@@ -1,5 +1,5 @@
<div class="rf-ddm-lbl rf-ddm-lbl-unsel "
id="form:ddmenu">
- <div class="rf-ddm-lbl-dec">
+ <div id="form:ddmenu_label" class="rf-ddm-lbl-dec">
<img src="/images/ddmenu/copy.gif" class="pic"/>
File
</div>