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
$stream.delegate(".reshare_button", "click", function(evt){
evt.preventDefault();
$(this).toggleClass("active")
.closest(".reshare_pane").children(".reshare_box").toggle();
button = $(this)
box = button.siblings(".reshare_box");
if(box.length > 0){
button.toggleClass("active");
box.toggle();
}
});
});//end document ready

View file

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