You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Sonarr/NzbDrone.Web/Scripts/NzbDrone/localSearch.js

41 lines
989 B

jQuery(document).ready(function () {
$.ajaxSetup({
cache: false
});
var selector = '#localSeriesLookup';
$(document).bind('keydown', 'ctrl+shift+f', function () {
$(selector).focus();
});
$(document).bind('keyup', 's', function () {
$(selector).focus();
});
$(selector).each(function (index, element) {
$(element).blur(function () {
$(element).val("");
});
$(element).watermark('Search...');
$(element).autocomplete({
source: "/Series/LocalSearch",
minLength: 1,
delay: 200,
autoFocus: true,
select: function (event, ui) {
window.location = "../Series/Details?seriesId=" + ui.item.Id;
}
})
.data("autocomplete")._renderItem = function (ul, item) {
return $("<li></li>")
.data("item.autocomplete", item)
.append("<a>" + item.Title + "<br>" + "</a>")
.appendTo(ul);
};
});
});