From 3fb6b0e0724318576d302b12f8dbfcd7d25e76c6 Mon Sep 17 00:00:00 2001 From: Raphael Date: Wed, 2 Feb 2011 11:52:00 -0800 Subject: [PATCH] Fix saved state cucumber feature --- app/views/layouts/_header.html.haml | 2 +- public/javascripts/aspect-filters.js | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml index b7002efad..f1b6d2c3f 100644 --- a/app/views/layouts/_header.html.haml +++ b/app/views/layouts/_header.html.haml @@ -42,7 +42,7 @@ -unless @landing_page %ul#aspect_nav %li{:class => ('selected' if @aspect == :all)} - = link_to t('_home'), root_path, :class => 'home_selector' + = link_to t('_home'), aspects_path, :class => 'home_selector' - for aspect in @all_aspects %li{:data=>{:guid=>aspect.id}, :class => ("selected" if @object_aspect_ids.include?(aspect.id))} diff --git a/public/javascripts/aspect-filters.js b/public/javascripts/aspect-filters.js index 83de67d5e..0b4f5dbd0 100644 --- a/public/javascripts/aspect-filters.js +++ b/public/javascripts/aspect-filters.js @@ -102,10 +102,6 @@ $(document).ready(function(){ return baseURL; } - $("a.home_selector").live("click", function(e){ - performAspectUpdate("home"); - }); - function performAspectUpdate(home){ // update the open aspects in the user updateURL = "/users/" + $('div.avatar').children('img').attr("data-owner_id"); @@ -118,7 +114,6 @@ $(document).ready(function(){ } } -//alert(updateURL); $.ajax({ url : updateURL, type: "PUT", @@ -126,6 +121,9 @@ $(document).ready(function(){ } + if($("a.home_selector").parent().hasClass("selected")){ + performAspectUpdate("home"); + } function performAjax(newURL) { var post = $("#publisher textarea").val(), @@ -176,7 +174,7 @@ $(document).ready(function(){ // reinit listeners on stream photozone.html(photos_html); Stream.initialize(); - + // fade contents back in if(requests == 0){ $("#aspect_stream_container").fadeTo(100, 1);