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

easyClose doesn't work if menu option is set to something other than 'menu' #56

Open
beau-gosse opened this issue Sep 19, 2015 · 8 comments

Comments

@beau-gosse
Copy link

If the menu option is changed to something other than the default 'menu', say $('#sidenav'), the panel doesn't close even when easyClose is set to true. The following error is also referenced in FF's console: ReferenceError: menu is not defined.

Not sure if this is a bug or something I'm doing.

@ascott1
Copy link
Owner

ascott1 commented Sep 20, 2015

@beau-gosse when initiating the plugin are you changing the menu option? Such as:

$( '#sidenav').bigSlide({
    menu: "#sidenav"
});

@beau-gosse
Copy link
Author

@ascott1 I tried the following two methods and both produced the results I described:

Method 1:

// .sidenav-trigger being the button used to open the sidenav
$('.sidenav-trigger').bigSlide({
    menu: '#sidenav',
    easyClose: true,
});

Method 2 (as you suggested):

$('#sidenav').bigSlide({
    menu: '#sidenav',
    easyClose: true,
});

Thanks for the prompt follow-up!

@ascott1
Copy link
Owner

ascott1 commented Sep 21, 2015

Sorry for the problems @beau-gosse! I'll start looking into it, but it may take a bit before I get there.

@jlblatt
Copy link
Contributor

jlblatt commented Oct 21, 2015

Hey, I just had to fix this for a client this morning, here's what I did- not sure if it's the 'right' answer but:

Line 157:
if (!$(e.target).parents().andSelf().is(menuLink) && !$(e.target).closest(menu).length && controller.getState() === 'open') {

Change to:
if (!$(e.target).parents().andSelf().is(menuLink) && !$(e.target).closest(settings.menu).length && controller.getState() === 'open') {

The variable 'menu' is not defined in this context, I assumed it should be the menu stored in the init settings, and it appears to work after making this change.

@ascott1
Copy link
Owner

ascott1 commented Oct 21, 2015

Nice catch @jblatt! I'd welcome a pull request, or I can make this update soon.

@jlblatt
Copy link
Contributor

jlblatt commented Oct 22, 2015

Hah, I'm just learning git on the command line but I'll give it shot!

@ascott1
Copy link
Owner

ascott1 commented Oct 22, 2015

Hah, I'm just learning git on the command line but I'll give it shot!

Yay! Hooray for open source!

@digitalgypsy
Copy link

Hi,

This mobile Safari fix didn't work for me unfortunately, just wondering if there has been any new updates since Oct 22?

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

No branches or pull requests

4 participants