Author: maksimkaszynski
Date: 2007-10-02 11:19:20 -0400 (Tue, 02 Oct 2007)
New Revision: 3198
Modified:
branches/3.1.x/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
Log:
http://jira.jboss.com/jira/browse/RF-1022
Modified:
branches/3.1.x/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
===================================================================
---
branches/3.1.x/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2007-10-02
14:59:54 UTC (rev 3197)
+++
branches/3.1.x/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2007-10-02
15:19:20 UTC (rev 3198)
@@ -153,17 +153,6 @@
this.upDown = 0;
},
- preventBlur:function(event) {
- Event.stop(event);
- },
-
- preventBlurByScroll: function() {
- Event.observe(this.update, "click", this.preventBlur);
- },
-
- enableBlurByScroll: function() {
- Event.stopObserving(this.update, "click", this.preventBlur);
- },
show: function() {
if ("SAFARI" == RichFaces.navigatorType()) {
this.wasScroll = false;
@@ -175,8 +164,6 @@
if (Element.getStyle(this.update, 'display')
== 'none') this.options.onShow(this.element, this.update,
this.options);
this.disableSubmit();
- this.preventBlurByScroll();
-
},
hide: function() {
@@ -188,7 +175,6 @@
Event.stopObserving(this.overflow, "scroll", this.onScrollListener)
}
this.stopIndicator();
- this.enableBlurByScroll();
if (Element.getStyle(this.update, 'display')
!= 'none') this.options.onHide(this.element, this.update,
this.options);
this.enableSubmit();
@@ -394,10 +380,17 @@
offsets["x"] = 0;
offsets["y"] = 0;
}
- if (event.clientX > offsets["x"] && event.clientX
- < (this.update.clientWidth + offsets["x"])) {
- if (event.clientY > (offsets["y"] - this.update.clientHeight)
- && event.clientY < offsets["y"]) {
+
+ var x = event.clientX +
+ document.body.scrollLeft +
+ document.documentElement.scrollLeft;
+
+ var y = event.clientY +
+ document.body.scrollTop+
+ document.documentElement.scrollTop;
+
+ if (x > offsets["x"] && x < (this.update.clientWidth +
offsets["x"])) {
+ if (y > (offsets["y"] - this.update.clientHeight) && y
< offsets["y"]) {
this.element.focus();
return;
}