userdropdown animation

This commit is contained in:
Kenneth Jao 2017-04-27 02:43:14 -04:00
parent 75be6fcfae
commit 69739367dc

View File

@ -501,7 +501,9 @@ Template.main.events({
}
}
if (!document.getElementById("userDropdown").contains(event.target)) $("#userDropdown").velocity("fadeOut", 150);
if (document.getElementById("userDropdown").style.display === "block" &&
!document.getElementById("userDropdown").contains(event.target))
$("#userDropdown").velocity("fadeOut", 150);
},
// MAIN MENU BUTTONS
'click .fa-bars' (event) { // Click menu button.