From d1c3326867017a808c76e6887924d329c2c7c7ba Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Thu, 31 Mar 2011 01:29:48 -0700 Subject: [PATCH] Revert "fix wacky aspect filtering bug (tabs being selected seemingly at random" This reverts commit 14f14d005bfa8b55b528f724f17c0b6885d1c861. --- public/javascripts/aspect-filters.js | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/public/javascripts/aspect-filters.js b/public/javascripts/aspect-filters.js index c8fb30de3..2c1ff1388 100644 --- a/public/javascripts/aspect-filters.js +++ b/public/javascripts/aspect-filters.js @@ -7,10 +7,19 @@ $(document).ready(function(){ var selectedGUIDS = [], requests = 0; + $("#aspect_nav li").each(function(){ + var button = $(this), + guid = button.attr('data-guid'); + + if(guid && location.href.search("a_ids..="+guid+"(&|$)") != -1){ + button.addClass('selected'); + selectedGUIDS.push(guid); + } + }); + // popstate $(window).bind("popstate", function(){ $.getScript(location.href); - setGUIDS(); return false; }); @@ -147,7 +156,6 @@ $(document).ready(function(){ // some browsers (Firefox for example) don't support pushState if (typeof(history.pushState) == 'function') { history.pushState(null, document.title, newURL); - setGUIDS(); } $.ajax({ @@ -190,17 +198,4 @@ $(document).ready(function(){ } - function setGUIDS(){ - selectedGUIDS = []; - $("li", "#aspect_nav").each(function(){ - var button = $(this), - guid = button.attr('data-guid'); - if(guid && location.href.search("a_ids..="+guid+"(&|$)") != -1){ - button.addClass('selected'); - selectedGUIDS.push(guid); - } - }); - console.log(selectedGUIDS); - } - });