Author: sergeyhalipov
Date: 2007-05-28 08:21:04 -0400 (Mon, 28 May 2007)
New Revision: 890
Modified:
trunk/richfaces/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
Log:
http://jira.jboss.com/jira/browse/RF-235
Modified:
trunk/richfaces/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
===================================================================
---
trunk/richfaces/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2007-05-28
11:41:31 UTC (rev 889)
+++
trunk/richfaces/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2007-05-28
12:21:04 UTC (rev 890)
@@ -139,6 +139,7 @@
show: function() {
if ("SAFARI" == RichFaces.navigatorType()) {
this.wasScroll = false;
+ this.wasBlur = false;
if (!this.overflow)
this.overflow = document.getElementsByClassName("dr-sb-overflow",
this.update)[0];
Event.observe(this.overflow, "scroll", this.onScrollListener);
@@ -160,6 +161,8 @@
if (Element.getStyle(this.update, 'display')
!= 'none') this.options.onHide(this.element, this.update,
this.options);
this.enableSubmit();
+ this.hasFocus = false;
+ this.active = false;
},
startIndicator: function() {
@@ -199,6 +202,7 @@
}
if (this.active) {
this.wasScroll = false;
+ this.wasBlur = false;
switch (event.keyCode) {
case Event.KEY_TAB:
case Event.KEY_RETURN:
@@ -293,6 +297,7 @@
onClick: function(event) {
this.wasScroll = false;
+ this.wasBlur = false;
var element = Event.findElement(event, 'TR');
this.index = element.autocompleteIndex;
this.selectEntry(event);
@@ -317,15 +322,15 @@
}
// needed to make click events working
setTimeout(this.hide.bind(this), 250);
- this.hasFocus = false;
- this.active = false;
+ this.wasBlur = true;
},
onScroll: function(event) {
- if ("SAFARI" == RichFaces.navigatorType()) {
+ if ("SAFARI" == RichFaces.navigatorType() && this.wasBlur ) {
if(this.element) {
this.element.focus();
this.wasScroll = true;
+ this.wasBlur = false;
}
}
},
@@ -554,8 +559,8 @@
if (this.onsubmitFunction && ! this.onsubmitFunction()) {
return;
- }
- if (this.oldValue != this.element.value && this.element.value.length > 0) {
+ }
+ if (this.oldValue != this.element.value && this.element.value.length > 0) {
A4J.AJAX.Submit(this.containerId, this.actionUrl, event, this.options);
}
return;