Author: maksimkaszynski
Date: 2007-10-02 10:52:07 -0400 (Tue, 02 Oct 2007)
New Revision: 3193
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-10-02
14:51:09 UTC (rev 3192)
+++
trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2007-10-02
14:52:07 UTC (rev 3193)
@@ -156,18 +156,7 @@
}
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;
@@ -179,7 +168,6 @@
if (Element.getStyle(this.update, 'display')
== 'none') this.options.onShow(this.element, this.update,
this.options);
this.disableSubmit();
- this.preventBlurByScroll();
},
hide: function() {
@@ -193,7 +181,6 @@
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;
@@ -393,14 +380,22 @@
this.wasBlur = true;
if (!this.active) return;
var offsets = RichFaces.Position.calcOffsets(this.update);
+
if (RichFaces.navigatorType() != "MSIE") {
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;
}