Author: nbelaevski
Date: 2008-06-11 12:26:13 -0400 (Wed, 11 Jun 2008)
New Revision: 9001
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-3646
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 2008-06-11
15:42:51 UTC (rev 9000)
+++
branches/3.1.x/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2008-06-11
16:26:13 UTC (rev 9001)
@@ -213,6 +213,15 @@
return true;
},
+ _findTr: function(event) {
+ var elt = Event.element(event);
+ while (elt && (!elt.tagName || elt.tagName.toUpperCase() != 'TR'))
{
+ elt = elt.parentNode;
+ }
+
+ return elt;
+ },
+
onKeyDown: function(event) {
if (this.isUnloaded()) return;
if (!this.initialized) {
@@ -226,7 +235,7 @@
this.update.parentNode.removeChild(this.update);
this.update = temp;
- var scripts = Element.select(temp, 'script');
+ var scripts = temp.getElementsByTagName('script');
for (var i = 0; i < scripts.length; i++) {
var script = scripts[i];
if (script.parentNode) {
@@ -352,7 +361,7 @@
},
onHover: function(event) {
- var element = Event.findElement(event, 'TR');
+ var element = this._findTr(event);//Event.findElement(event, 'TR');
if (!this.skipHover) {
if (this.index != element.autocompleteIndex) {
this.index = element.autocompleteIndex;
@@ -371,14 +380,14 @@
onClick: function(event) {
this.wasScroll = false;
this.wasBlur = false;
- var element = Event.findElement(event, 'TR');
+ var element = this._findTr(event);//Event.findElement(event, 'TR');
this.index = element.autocompleteIndex;
this.selectEntry(event);
this.hide();
},
onMouseOut: function(event) {
- var element = Event.findElement(event, 'TR');
+ var element = this._findTr(event);//Event.findElement(event, 'TR');
Event.stopObserving(element, "mousemove", this.onHover);
},