From bfb132280a18e8a87885c0a13e245d904352d764 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Sun, 31 Oct 2010 14:30:03 -0700 Subject: [PATCH] reshare button displays dropdown on click --- public/javascripts/stream.js | 9 +++++++-- public/javascripts/view.js | 5 +---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/public/javascripts/stream.js b/public/javascripts/stream.js index ae6ae7d91..36fd5e619 100644 --- a/public/javascripts/stream.js +++ b/public/javascripts/stream.js @@ -44,8 +44,13 @@ $(document).ready(function(){ $("#stream").delegate(".reshare_button", "click", function(evt){ evt.preventDefault(); var button = $(this); - button.closest(".reshare_pane").children(".reshare_box").show(); - button.addClass("active"); + if(button.hasClass("active")) { + button.closest(".reshare_pane").children(".reshare_box").hide(); + button.removeClass("active"); + } else { + button.closest(".reshare_pane").children(".reshare_box").show(); + button.addClass("active"); + } }); });//end document ready diff --git a/public/javascripts/view.js b/public/javascripts/view.js index 8cbc5786c..a129330ca 100644 --- a/public/javascripts/view.js +++ b/public/javascripts/view.js @@ -68,14 +68,11 @@ $(document).ready(function(){ if(!$(event.target).closest('#user_menu').length){ $("#user_menu").removeClass("active"); }; - if(!$(event.target).closest('.reshare_box').length){ + if(!$(event.target).closest('.reshare_pane').length){ $(".reshare_button").removeClass("active"); $(".reshare_box").hide(); }; }); - - //$("#slider").easySlider({speed:400}); - $("img", "#left_pane").tipsy({live:true}); $(".add_aspect_button", "#aspect_nav").tipsy({gravity:'w'});