From 9169293323e27696a4f378ae7847ccb3c6c7789a Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Wed, 1 Oct 2014 20:00:03 -0400 Subject: [PATCH] small fix for minimizing search results --- .../javascripts/src/Metamaps.GlobalUI.js | 41 ++++++++----------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/app/assets/javascripts/src/Metamaps.GlobalUI.js b/app/assets/javascripts/src/Metamaps.GlobalUI.js index b1eb4afa..69b7f190 100644 --- a/app/assets/javascripts/src/Metamaps.GlobalUI.js +++ b/app/assets/javascripts/src/Metamaps.GlobalUI.js @@ -621,30 +621,25 @@ Metamaps.GlobalUI.Search = { } } - if (!self.optionsInitialized) { + $('.limitToMe').unbind().bind("change", function (e) { + // set the value of the search equal to itself to retrigger the autocomplete event + self.isOpen = false; + $('.sidebarSearchField').typeahead('setQuery', $('.sidebarSearchField').val()); + setTimeout(function () { + self.isOpen = true; + }, 2000); + }); - $('.limitToMe').bind("change", function (e) { - // set the value of the search equal to itself to retrigger the autocomplete event - self.isOpen = false; - $('.sidebarSearchField').typeahead('setQuery', $('.sidebarSearchField').val()); - setTimeout(function () { - self.isOpen = true; - }, 2000); - }); - - // when the user clicks minimize section, hide the results for that section - $('.minimizeMapperResults').click(function (e) { - toggleResultSet.call(this, 'mappers'); - }); - $('.minimizeTopicResults').click(function (e) { - toggleResultSet.call(this, 'topics'); - }); - $('.minimizeMapResults').click(function (e) { - toggleResultSet.call(this, 'maps'); - }); - - self.optionsInitialized = true; - } + // when the user clicks minimize section, hide the results for that section + $('.minimizeMapperResults').unbind().click(function (e) { + toggleResultSet.call(this, 'mappers'); + }); + $('.minimizeTopicResults').unbind().click(function (e) { + toggleResultSet.call(this, 'topics'); + }); + $('.minimizeMapResults').unbind().click(function (e) { + toggleResultSet.call(this, 'maps'); + }); }, hideLoader: function () { $('#searchLoading').hide();