Commit adedd244 authored by catch's avatar catch

Issue #675446 by droplet: Regressions: Use jQuery UI Autocomplete.

parent a979bbda
......@@ -154,6 +154,20 @@
return false;
}
/**
* Override jQuery UI _renderItem function to output HTML by default.
*
* @param {Object} ul
* @param {Object} item
*
* @return {Object}
*/
function renderItem (ul, item) {
return $("<li>")
.append( $("<a>").html(item.label))
.appendTo( ul );
}
/**
* Attaches the autocomplete behavior to all required fields.
*/
......@@ -163,7 +177,9 @@
var $autocomplete = $(context).find('input.form-autocomplete').once('autocomplete');
if ($autocomplete.length) {
// Use jQuery UI Autocomplete on the textfield.
$autocomplete.autocomplete(autocomplete.options);
$autocomplete.autocomplete(autocomplete.options)
.data("ui-autocomplete")
._renderItem = autocomplete.options.renderItem;
}
},
detach: function (context, settings, trigger) {
......@@ -189,7 +205,8 @@
source: sourceData,
focus: focusHandler,
search: searchHandler,
select: selectHandler
select: selectHandler,
renderItem: renderItem
},
ajax: {
dataType: 'json'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment