From 3bad9dcaf5dcf7ffc8a2ad2b1772f4f83dee8dda Mon Sep 17 00:00:00 2001 From: anurse Date: Thu, 31 Oct 2013 14:57:51 -0700 Subject: [PATCH] Fixed #1683 by making expanding search opt-in --- src/NuGetGallery/Scripts/nugetgallery.js | 7 ++++++- src/NuGetGallery/Views/Shared/Layout.cshtml | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/NuGetGallery/Scripts/nugetgallery.js b/src/NuGetGallery/Scripts/nugetgallery.js index de26b1d72a..1ea9f74698 100644 --- a/src/NuGetGallery/Scripts/nugetgallery.js +++ b/src/NuGetGallery/Scripts/nugetgallery.js @@ -2,6 +2,11 @@ /// (function (window, $, undefined) { function attachSearchBoxBehavior($input, $menu) { + if ($input.length == 0 || $menu.length == 0) { + // If we were given nothing, just return. + return; + } + // Remember the previous state in order to perform smooth animation transforms var prevstate = false; function popit(assumeFocused) { @@ -72,7 +77,7 @@ // Get the service status checkServiceStatus(); - attachSearchBoxBehavior($('#searchBoxInput'), $('#menu')); + attachSearchBoxBehavior($('#searchBoxInput.expanding-search'), $('#menu.expanding-search')); }); // Add validator that ensures provided value is NOT equal to a specified value. diff --git a/src/NuGetGallery/Views/Shared/Layout.cshtml b/src/NuGetGallery/Views/Shared/Layout.cshtml index 361d77108c..c5d5456a4f 100644 --- a/src/NuGetGallery/Views/Shared/Layout.cshtml +++ b/src/NuGetGallery/Views/Shared/Layout.cshtml @@ -21,7 +21,7 @@ @Html.Partial(MVC.Shared.Views.UserDisplay)