Slight tweak to userlist dropdown hiding

This commit is contained in:
calzoneman 2013-10-16 23:10:59 -05:00
parent 033fbbf08a
commit f8fcc0d2d7
2 changed files with 13 additions and 0 deletions

View file

@ -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?

View file

@ -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();