Author: sergeyhalipov
Date: 2007-07-27 09:34:47 -0400 (Fri, 27 Jul 2007)
New Revision: 1891
Modified:
trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
Log:
http://jira.jboss.com/jira/browse/RF-450
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-07-27
13:26:56 UTC (rev 1890)
+++
trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2007-07-27
13:34:47 UTC (rev 1891)
@@ -184,9 +184,8 @@
},
hideNLabel: function(event) {
- var TRs = document.getElementsByClassName("dr-sb-int", this.update);
- var nothingLabel = TRs[TRs.length - 1];
- if (/NothingLabel/.test(nothingLabel.id)) {
+ var nothingLabel = $(this.update.id + "NothingLabel");
+ if (nothingLabel) {
Element.hide(nothingLabel);
Event.stopObserving(nothingLabel, "click", this.onNothingLabelClick);
this.hide();
@@ -489,8 +488,11 @@
this.active = true;
}
} else {
- this.active = false;
- this.hide();
+ var nothingLabel = $(this.update.id + "NothingLabel");
+ if (!nothingLabel || 'none' == nothingLabel.style.display) {
+ this.active = false;
+ this.hide();
+ }
}
},
@@ -612,18 +614,18 @@
scroll.scrollLeft = -1;
this.index = 0;
this.prevIndex = -1;
- this.render();
- }
-
- var TRs = document.getElementsByClassName("dr-sb-int", this.update);
- var nothingLabel = TRs[TRs.length - 1];
- if (/NothingLabel/.test(nothingLabel.id)) {
+
+ var nothingLabel = $(this.update.id + "NothingLabel");
+ if (nothingLabel) {
if (this.entryCount < 1) {
Element.show(nothingLabel);
- Event.observe(nothingLabel, "click", this.onNothingLabelClick);
- this.show();
+ Event.observe(nothingLabel, "click", this.onNothingLabelClick);
+ this.show();
}
}
+
+ this.render();
+ }
},
addObservers: function(element) {