Author: maksimkaszynski
Date: 2007-09-27 13:16:05 -0400 (Thu, 27 Sep 2007)
New Revision: 3153
Modified:
trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
Log:
http://jira.jboss.com/jira/browse/RF-1022
Modified:
trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
===================================================================
---
trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2007-09-27
16:21:40 UTC (rev 3152)
+++
trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2007-09-27
17:16:05 UTC (rev 3153)
@@ -79,7 +79,11 @@
this.element.setAttribute('autocomplete', 'off');
Element.hide(this.update);
-
+
+ this.preventBlur = function(event) {
+ Event.stop(event);
+ };
+
this.onBlurListener = this.onBlur.bindAsEventListener(this);
Event.observe(this.element, "blur", this.onBlurListener);
@@ -138,6 +142,7 @@
Event.observe(el, "submit", this.onSubmitListener);
}
}
+
},
enableSubmit: function() {
@@ -154,6 +159,14 @@
}
this.upDown = 0;
},
+
+ preventBlurByScroll: function() {
+ Event.observe(this.update, "click", this.preventBlur);
+ },
+
+ enableBlurByScroll: function() {
+ Event.stopObserving(this.update, "click", this.preventBlur);
+ },
show: function() {
if ("SAFARI" == RichFaces.navigatorType()) {
@@ -166,7 +179,7 @@
if (Element.getStyle(this.update, 'display')
== 'none') this.options.onShow(this.element, this.update,
this.options);
this.disableSubmit();
-
+ this.preventBlurByScroll();
},
hide: function() {
@@ -180,6 +193,7 @@
this.stopIndicator();
if (Element.getStyle(this.update, 'display')
!= 'none') this.options.onHide(this.element, this.update,
this.options);
+ this.enableBlurByScroll();
this.enableSubmit();
this.hasFocus = false;
this.active = false;