diff --git a/core/misc/autocomplete.js b/core/misc/autocomplete.js
index 0ffe404..671b80f 100644
--- a/core/misc/autocomplete.js
+++ b/core/misc/autocomplete.js
@@ -221,15 +221,20 @@ Drupal.jsAC.prototype.found = function (matches) {
// Prepare matches.
var ul = $('
');
var ac = this;
+
+ function autocompleteInit (element) {
+ $(element)
+ .html($('').html(matches[key]))
+ .mousedown(function () { ac.select(this); })
+ .mouseover(function () { ac.highlight(this); })
+ .mouseout(function () { ac.unhighlight(this); })
+ .data('autocompleteValue', key)
+ .appendTo(ul);
+ }
for (var key in matches) {
if (matches.hasOwnProperty(key)) {
- $('')
- .html($('').html(matches[key]))
- .mousedown(function () { ac.select(this); })
- .mouseover(function () { ac.highlight(this); })
- .mouseout(function () { ac.unhighlight(this); })
- .data('autocompleteValue', key)
- .appendTo(ul);
+ var li = '';
+ autocompleteInit(li);
}
}
@@ -312,7 +317,7 @@ Drupal.ACDB.prototype.search = function (searchString) {
}
},
error: function (xmlhttp) {
- alert(Drupal.ajaxError(xmlhttp, db.uri));
+ window.alert(Drupal.ajaxError(xmlhttp, db.uri));
}
});
}, this.delay);