mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 21:43:33 -07:00
Updated localsearch UI.
This commit is contained in:
parent
59fcb5f138
commit
3bcbc713f3
7 changed files with 31 additions and 167 deletions
|
@ -4,6 +4,13 @@
|
|||
});
|
||||
|
||||
bindAutoCompletes();
|
||||
|
||||
$(document).bind('keydown', 'ctrl+shift+f', function () {
|
||||
$('#localSeriesLookup').focus();
|
||||
});
|
||||
$(document).bind('keyup', 's', function () {
|
||||
$('#localSeriesLookup').focus();
|
||||
});
|
||||
});
|
||||
|
||||
//
|
||||
|
@ -14,11 +21,10 @@ $('.folderLookup:not(.ui-autocomplete-input), .seriesLookup:not(.ui-autocomplete
|
|||
function bindAutoCompletes() {
|
||||
bindFolderAutoComplete(".folderLookup");
|
||||
bindSeriesAutoComplete(".seriesLookup");
|
||||
bindLocalSeriesAutoComplete(".localSeriesLookup");
|
||||
bindLocalSeriesAutoComplete("#localSeriesLookup");
|
||||
}
|
||||
|
||||
function bindFolderAutoComplete(selector) {
|
||||
|
||||
$(selector).each(function (index, element) {
|
||||
$(element).autocomplete({
|
||||
//source: "/Directory/GetDirectories",
|
||||
|
@ -66,10 +72,12 @@ function bindSeriesAutoComplete(selector) {
|
|||
function bindLocalSeriesAutoComplete(selector) {
|
||||
|
||||
$(selector).each(function (index, element) {
|
||||
$(element).watermark('Search...');
|
||||
$(element).autocomplete({
|
||||
source: "/Series/LocalSearch",
|
||||
minLength: 3,
|
||||
delay: 500,
|
||||
minLength: 1,
|
||||
delay: 100,
|
||||
autoFocus:true,
|
||||
select: function (event, ui) {
|
||||
window.location = "../Series/Details?seriesId=" + ui.item.Id;
|
||||
}
|
||||
|
|
|
@ -1,46 +0,0 @@
|
|||
$(document).ready(function () {
|
||||
$(".sliderButton").live('click', function () {
|
||||
sliderToggle(this);
|
||||
});
|
||||
});
|
||||
|
||||
function sliderToggle(sliderButton) {
|
||||
//Get sliderContent
|
||||
var sliderContent = $(sliderButton).siblings('.sliderContent');
|
||||
|
||||
//Open the slider
|
||||
sliderContent.slideToggle('slow');
|
||||
|
||||
//Change the slider Image
|
||||
$(sliderButton).children('.sliderImage').toggleClass('sliderOpened sliderClosed');
|
||||
|
||||
//Clear the search box
|
||||
$(sliderContent).children('.localSeriesLookup').val('');
|
||||
|
||||
//Focus in the search box
|
||||
$(sliderContent).children('.localSeriesLookup').focus();
|
||||
|
||||
//Hide the sliders
|
||||
hideSliders(sliderContent);
|
||||
|
||||
//Prevent the Address Bar from changing
|
||||
return false;
|
||||
}
|
||||
|
||||
function hideSliders(newlyOpenedSlider) {
|
||||
$('.sliderContent').each(function (index, value) {
|
||||
var newlyOpenedSliderId = $(newlyOpenedSlider).parent('.top-slider').attr('id');
|
||||
var id = $(this).parent('.top-slider').attr('id');
|
||||
|
||||
//If the ID's of the top-sliders don't match then hide it
|
||||
if (id != newlyOpenedSliderId)
|
||||
$(this).slideUp();
|
||||
});
|
||||
}
|
||||
|
||||
//Hide slider when text box loses focus
|
||||
$('.localSeriesLookup').live('blur', function () {
|
||||
$('.sliderContent').each(function (index, value) {
|
||||
$(this).slideUp();
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue