Fix reshare, user_menu

This commit is contained in:
Raphael 2010-11-01 17:30:10 -07:00
parent bd6a8df7cc
commit fd0f3a9a1c
2 changed files with 9 additions and 5 deletions

View file

@ -43,8 +43,12 @@ $(document).ready(function(){
// reshare button action // reshare button action
$stream.delegate(".reshare_button", "click", function(evt){ $stream.delegate(".reshare_button", "click", function(evt){
evt.preventDefault(); evt.preventDefault();
$(this).toggleClass("active") button = $(this)
.closest(".reshare_pane").children(".reshare_box").toggle(); box = button.siblings(".reshare_box");
if(box.length > 0){
button.toggleClass("active");
box.toggle();
}
}); });
});//end document ready });//end document ready

View file

@ -64,11 +64,11 @@ $(document).ready(function(){
}); });
$('body').click( function(event){ $('body').click( function(event){
var $this = $(this); var target = $(event.target);
if(!$this.closest('#user_menu').length){ if(!target.closest('#user_menu').length){
$("#user_menu").removeClass("active"); $("#user_menu").removeClass("active");
}; };
if(!$this.closest('.reshare_pane').length){ if(!target.closest('.reshare_pane').length){
$(".reshare_button").removeClass("active"); $(".reshare_button").removeClass("active");
$(".reshare_box").hide(); $(".reshare_box").hide();
}; };