Author: vmolotkov
Date: 2008-07-30 09:59:41 -0400 (Wed, 30 Jul 2008)
New Revision: 9829
Modified:
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
Log:
https://jira.jboss.org/jira/browse/RF-4029
Modified:
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
===================================================================
---
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2008-07-30
13:56:36 UTC (rev 9828)
+++
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2008-07-30
13:59:41 UTC (rev 9829)
@@ -78,6 +78,7 @@
this.field.observe("keyup",
function(e){this.dataUpdating(e);}.bindAsEventListener(this));
this.comboList.listParent.observe("mousedown",
function(e){this.listMousedownHandler(e);}.bindAsEventListener(this));
+ this.comboList.listParent.observe("mouseup",
function(e){this.listMouseUpHandler(e);}.bindAsEventListener(this));
this.comboList.listParent.observe("mousemove",
function(e){this.listMouseMoveHandler(e)}.bindAsEventListener(this));
this.comboList.listParent.observe("click",
function(e){this.listClickHandler(e);}.bindAsEventListener(this));
},
@@ -161,16 +162,26 @@
this.comboList.isList = true;
} else if (Prototype.Browser.Gecko) {
if (this.comboList.getEventItem(e)) {
- this.comboList.isList = true;
+ this.comboList.isList = true;
}
} else {
this.comboList.isList = true;
}
},
+ listMouseUpHandler : function(e) {
+ if (window.getSelection) {
+ if (window.getSelection().getRangeAt(0).toString() != '') {
+ this.field.focus();
+ this.comboList.isList = false;
+ }
+ }
+ },
+
listClickHandler : function(event) {
this.isSelection = false;
- this.field.focus();
+ //FF
+ //this.field.focus();
this.setValue(true);
this.comboList.hideWithDelay();
},