Author: chrisz
Date: Wed Jan 23 11:34:57 2008
New Revision: 4032
URL: http://trac.turbogears.org/changeset/4032
Log:
Another small simplification in the AutoCompleteField Javascript.
Modified:
branches/1.1/turbogears/widgets/static/autocompletefield.js
Modified: branches/1.1/turbogears/widgets/static/autocompletefield.js
==============================================================================
--- branches/1.1/turbogears/widgets/static/autocompletefield.js (original)
+++ branches/1.1/turbogears/widgets/static/autocompletefield.js Wed Jan 23
11:34:57 2008
@@ -164,10 +164,9 @@
swapElementClass("autoComplete" + this.id + i,
"autoTextSelectedRow", "autoTextNormalRow");
}
// Move the cursor to the end of the line
- var textField = getElement(this.textField);
- var value = textField.value
- textField.value = "";
- textField.value = value;
+ var value = this.textField.value
+ this.textField.value = "";
+ this.textField.value = value;
}
AutoCompleteManager.prototype.clearResults = function() {
@@ -245,9 +244,8 @@
// Swap out the old results with the newly created table
var resultsHolder = getElement("autoCompleteResults" + this.id);
if (this.isShowingResults) {
- var textField = getElement(this.textField);
- resultsHolder.style.left = getLeft(textField) + "px";
- resultsHolder.style.top = getBottom(textField) + 1 + "px";
+ resultsHolder.style.left = getLeft(this.textField) + "px";
+ resultsHolder.style.top = getBottom(this.textField) + 1 + "px";
replaceChildNodes(resultsHolder, fancyTable);
this.updateSelectedResult();
showElement(resultsHolder);