Stop the menu appearing when the anchor is disabled
This commit is contained in:
parent
e2cb47f1ae
commit
cca526d939
1 changed files with 10 additions and 8 deletions
|
@ -34,14 +34,16 @@ function createMenu(anchorid, menuid, align) {
|
|||
}
|
||||
|
||||
$arrow.click(function(e) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
if ($menu.is(":visible")) {
|
||||
$menu.hide();
|
||||
$page.off("click", hide);
|
||||
} else {
|
||||
openMenu($anchor, $menu.show(), align);
|
||||
$page.on("click", hide);
|
||||
if ($anchor.is(":not(.disabled)")) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
if ($menu.is(":visible")) {
|
||||
$menu.hide();
|
||||
$page.off("click", hide);
|
||||
} else {
|
||||
openMenu($anchor, $menu.show(), align);
|
||||
$page.on("click", hide);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue