Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close menu on clicking outside menu #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

satrapal
Copy link

Added e.stopPropagation() for .cbp-spmenu class. It's possible clicking inside menu without close them. Standard tags working differently and menu disappear when you press them.

Added e.stopPropagation() for .cbp-spmenu class. It's possible clicking inside menu without close them. Standard <a> tags working differently and menu disappear when you press them.
@Vilmorq
Copy link

Vilmorq commented Mar 23, 2016

Need a little fix for some logic.
Change string in //Close menu on clicking outside menu
jPushMenu.close(o);

on

if ($(e.target).closest(".menu-open").length) {
return;
} else {
jPushMenu.close(o);
}

plus add e in click-function

With
closeOnClickLink : false
u can make rly useful sidebar :) Just imho

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants