1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-21 01:49:57 +02:00
Sonarr/NzbDrone.Backbone/Shared/AutoComplete.js
kay.one 7093f352fe splited MVC and nancy application
backbone app is now fully served from nancy including css,js,html
2013-02-17 18:13:21 -08:00

21 lines
556 B
JavaScript

define(['app'], function () {
$.fn.autoComplete = function (resource) {
$(this).typeahead({
source: function (filter, callback) {
$.ajax({
url: NzbDrone.Constants.ApiRoot + resource,
dataType: "json",
type: "GET",
data: { query: filter },
success: function (data) {
callback(data);
}
});
},
minLength: 3
});
};
});