diff --git a/NzbDrone.Web/Content/Slider.css b/NzbDrone.Web/Content/Slider.css index aa76fce7b..c8bc3b200 100644 --- a/NzbDrone.Web/Content/Slider.css +++ b/NzbDrone.Web/Content/Slider.css @@ -25,20 +25,17 @@ -webkit-border-bottom-left-radius: 8px; } -.openCloseWrapper { - width: 100%; - text-align: center; - font-size:12px; - font-weight:bold; - color:#FFFFFF; -} - -.sliderButtonContainer { +.sliderButton { width: 70px; margin-left:auto; margin-right:auto; background-color:#333333; cursor:pointer; + font-size:12px; + font-weight:bold; + text-align: center; + color:#FFFFFF; + @*Rounded Edges*@ border: 1px solid #444444; diff --git a/NzbDrone.Web/Scripts/slider.js b/NzbDrone.Web/Scripts/slider.js index ce6af3880..ec4b97f17 100644 --- a/NzbDrone.Web/Scripts/slider.js +++ b/NzbDrone.Web/Scripts/slider.js @@ -1,13 +1,36 @@ $(document).ready(function () { - $(".sliderButtonContainer").live('click', function () { - sliderToggle(); + $(".sliderButton").live('click', function () { + sliderToggle(this); }); }); -function sliderToggle() { - $('.sliderContent').slideToggle('slow'); +function sliderToggle(sliderButton) { + //Get sliderContent + var sliderContent = $(sliderButton).siblings('.sliderContent'); + + //Open the slider + sliderContent.slideToggle('slow'); + + //Change the slider Image $(".sliderButtonContainer").children('.sliderImage').toggleClass('sliderOpened sliderClosed'); + //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(); + }); } \ No newline at end of file diff --git a/NzbDrone.Web/Views/Shared/LocalSearch.cshtml b/NzbDrone.Web/Views/Shared/LocalSearch.cshtml index b06f5700e..fc71b200d 100644 --- a/NzbDrone.Web/Views/Shared/LocalSearch.cshtml +++ b/NzbDrone.Web/Views/Shared/LocalSearch.cshtml @@ -21,9 +21,7 @@ Local Series Search -
-
- Search
-
+
+ Search
\ No newline at end of file