diff options
Diffstat (limited to 'misc/autocomplete.js')
-rw-r--r-- | misc/autocomplete.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/misc/autocomplete.js b/misc/autocomplete.js index 02a886c21..267d4b79b 100644 --- a/misc/autocomplete.js +++ b/misc/autocomplete.js @@ -32,7 +32,7 @@ Drupal.behaviors.autocomplete = { Drupal.autocompleteSubmit = function () { return $('#autocomplete').each(function () { this.owner.hidePopup(); - }).size() == 0; + }).length == 0; }; /** @@ -123,7 +123,7 @@ Drupal.jsAC.prototype.selectDown = function () { } else if (this.popup) { var lis = $('li', this.popup); - if (lis.size() > 0) { + if (lis.length > 0) { this.highlight(lis.get(0)); } } @@ -227,7 +227,7 @@ Drupal.jsAC.prototype.found = function (matches) { // Show popup with matches, if any. if (this.popup) { - if (ul.children().size()) { + if (ul.children().length) { $(this.popup).empty().append(ul).show(); $(this.ariaLive).html(Drupal.t('Autocomplete popup')); } @@ -287,10 +287,11 @@ Drupal.ACDB.prototype.search = function (searchString) { this.timer = setTimeout(function () { db.owner.setStatus('begin'); - // Ajax GET request for autocompletion. + // Ajax GET request for autocompletion. We use Drupal.encodePath instead of + // encodeURIComponent to allow autocomplete search terms to contain slashes. $.ajax({ type: 'GET', - url: db.uri + '/' + encodeURIComponent(searchString), + url: db.uri + '/' + Drupal.encodePath(searchString), dataType: 'json', success: function (matches) { if (typeof matches.status == 'undefined' || matches.status != 0) { |