Menu: fix early-menu-hide bug when click on menu item (closes #1706)

This commit is contained in:
Yevhen Tiurin 2015-10-08 14:22:28 +07:00 committed by Surma
parent 3063d39fcb
commit 39dfe0d251

View File

@ -409,7 +409,9 @@
// displayed the menu in the first place. If so, do nothing.
// Also check to see if the menu is in the process of closing itself, and
// do nothing in that case.
if (e !== evt && !this.closing_) {
// Also check if the clicked element is a menu item
// if so, do nothing.
if (e !== evt && !this.closing_ && e.target.parentNode !== this.element_) {
document.removeEventListener('click', callback);
this.hide();
}