From 02bb2fa19f7132848f3023a5af74c9483b082fd6 Mon Sep 17 00:00:00 2001 From: Dan Hansen Date: Sun, 12 Dec 2010 01:38:28 -0500 Subject: [PATCH] hide reshare menu if you click somewhere it's not --- public/javascripts/view.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/public/javascripts/view.js b/public/javascripts/view.js index 6d33b6655..b21d589a5 100644 --- a/public/javascripts/view.js +++ b/public/javascripts/view.js @@ -64,7 +64,8 @@ var View = { .submit(this.webFingerForm.submit); $(document.body) - .click(this.userMenu.removeFocus); + .click(this.userMenu.removeFocus) + .click(this.reshareButton.removeFocus); }, addAspectButton: { @@ -186,6 +187,15 @@ var View = { } }, + reshareButton: { + removeFocus: function(evt) { + var $target = $(evt.target); + if(!$target.closest(".reshare_pane").length) { + $(".reshare_button.active").removeClass("active").siblings(".reshare_box").css("display", "none"); + } + } + }, + userMenu: { click: function() { $(this).toggleClass("active");