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

Slideout.close() method doesn't remove slideout-open class from html tag #196

Closed
alexandr-bbm opened this issue Oct 12, 2016 · 1 comment
Labels

Comments

@alexandr-bbm
Copy link

Thank the authors for this nice lib.

We noticed some kind of bug case:
User opens a modal popup from slideout menu. Our modal component adds class modal-open to the <body > tag via jQuery.addClass() method. So, the class attribute of <body> tag changes from ' slideout-opento 'slideout-open modal-open (please notice a dissapeared space before slideout-open). Then, we need to close slideout programmatically which is done by Slideout.Close() method. However, this method removes the class in the following way:
html.className = html.className.replace(/ slideout-open/, ''); Source: Line 123
i.e. it supposes class slideout-open to have a space before it.

Why can't we replace slideout-open class without the space before it? This will solve this case and will not break any other.

@pazguille
Copy link
Member

Hi @alexandr-bbm! Yes, you are right. I'm going to work on a new version using classList to avoid these issues with .add() and .remove() methods.

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

No branches or pull requests

2 participants