diff --git a/NzbDrone.Web/NzbDrone.Web.csproj b/NzbDrone.Web/NzbDrone.Web.csproj index 1869e3399..466fdcddb 100644 --- a/NzbDrone.Web/NzbDrone.Web.csproj +++ b/NzbDrone.Web/NzbDrone.Web.csproj @@ -378,6 +378,7 @@ + diff --git a/NzbDrone.Web/Scripts/NzbDrone/AutoComplete.js b/NzbDrone.Web/Scripts/NzbDrone/AutoComplete.js index d5ba70757..351f9126a 100644 --- a/NzbDrone.Web/Scripts/NzbDrone/AutoComplete.js +++ b/NzbDrone.Web/Scripts/NzbDrone/AutoComplete.js @@ -8,12 +8,8 @@ $(document).bind('keydown', 'ctrl+shift+f', function () { $('#localSeriesLookup').focus(); }); - $(document).bind('keyup', 's', function () { - $('#localSeriesLookup').focus(); - }); }); -// $('.folderLookup:not(.ui-autocomplete-input), .seriesLookup:not(.ui-autocomplete-input), .localSeriesLookup:not(.ui-autocomplete-input)').live('focus', function (event) { bindAutoCompletes(); }); @@ -21,7 +17,6 @@ $('.folderLookup:not(.ui-autocomplete-input), .seriesLookup:not(.ui-autocomplete function bindAutoCompletes() { bindFolderAutoComplete(".folderLookup"); bindSeriesAutoComplete(".seriesLookup"); - bindLocalSeriesAutoComplete("#localSeriesLookup"); } function bindFolderAutoComplete(selector) { @@ -68,25 +63,3 @@ function bindSeriesAutoComplete(selector) { }; }); } - -function bindLocalSeriesAutoComplete(selector) { - - $(selector).each(function (index, element) { - $(element).watermark('Search...'); - $(element).autocomplete({ - source: "/Series/LocalSearch", - minLength: 1, - delay: 100, - autoFocus:true, - select: function (event, ui) { - window.location = "../Series/Details?seriesId=" + ui.item.Id; - } - }) - .data("autocomplete")._renderItem = function (ul, item) { - return $("
  • ") - .data("item.autocomplete", item) - .append("" + item.Title + "
    " + "
    ") - .appendTo(ul); - }; - }); -} \ No newline at end of file diff --git a/NzbDrone.Web/Scripts/NzbDrone/LocalSearch.js b/NzbDrone.Web/Scripts/NzbDrone/LocalSearch.js new file mode 100644 index 000000000..7fe27afbd --- /dev/null +++ b/NzbDrone.Web/Scripts/NzbDrone/LocalSearch.js @@ -0,0 +1,41 @@ +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 $("
  • ") + .data("item.autocomplete", item) + .append("" + item.Title + "
    " + "
    ") + .appendTo(ul); + }; + }); +}); \ No newline at end of file diff --git a/NzbDrone.Web/Views/AddSeries/Index.cshtml b/NzbDrone.Web/Views/AddSeries/Index.cshtml index 5956ef715..f6b6bfe07 100644 --- a/NzbDrone.Web/Views/AddSeries/Index.cshtml +++ b/NzbDrone.Web/Views/AddSeries/Index.cshtml @@ -2,9 +2,13 @@ @section TitleContent{ Add Series } - +@section Scripts +{ + +} @section MainContent{ -

    Add New Series

    +

    + Add New Series

    @{ Html.RenderAction("AddNew", "AddSeries"); }
    diff --git a/NzbDrone.Web/Views/Shared/_Layout.cshtml b/NzbDrone.Web/Views/Shared/_Layout.cshtml index 25c48cbad..4d424de52 100644 --- a/NzbDrone.Web/Views/Shared/_Layout.cshtml +++ b/NzbDrone.Web/Views/Shared/_Layout.cshtml @@ -48,7 +48,6 @@ background notification @(Html.Telerik().ScriptRegistrar().jQuery(true)) - @* *@ @@ -60,7 +59,7 @@ - + @RenderSection("Scripts", required: false) @if (EnviromentProvider.IsProduction)