From f8fcc0d2d7aebe3f30c27cef1a07ca7277076ea4 Mon Sep 17 00:00:00 2001 From: calzoneman Date: Wed, 16 Oct 2013 23:10:59 -0500 Subject: [PATCH] Slight tweak to userlist dropdown hiding --- changelog | 5 +++++ www/assets/js/util.js | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/changelog b/changelog index 4fb0e8c5..882b5693 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,8 @@ +Wed Oct 16 23:09 2013 CDT + * www/assets/js/util.js: Add a special handler so that clicking + anywhere on the page clears a userlist dropdown, not just right + clicking the same name. + Wed Oct 16 21:48 2013 CDT * www/assets/js/player.js: Add a stupid timeout hack to address a race condition in YouTube's HTML5 player. Seriously? diff --git a/www/assets/js/util.js b/www/assets/js/util.js index 1dbcd37b..415c6e4c 100644 --- a/www/assets/js/util.js +++ b/www/assets/js/util.js @@ -257,6 +257,14 @@ function addUserDropdown(entry, data) { entry.contextmenu(function(ev) { ev.preventDefault(); if(menu.css("display") == "none") { + $(".user-dropdown").hide(); + $(document).bind("mouseup.userlist-ddown", function (e) { + if (menu.has(e.target).length === 0 && + entry.parent().has(e.target).length === 0) { + menu.hide(); + $(document).unbind("mouseup.userlist-ddown"); + } + }); menu.show(); } else { menu.hide();