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

Disable stacking: Close current modal when calling another #146

Closed
hwaal opened this issue Jun 15, 2014 · 6 comments
Closed

Disable stacking: Close current modal when calling another #146

hwaal opened this issue Jun 15, 2014 · 6 comments
Milestone

Comments

@hwaal
Copy link

hwaal commented Jun 15, 2014

Is it possible to close the current modal when calling a new modal from within the current one?

The problem now is when I close the current modal the previous modal will be active beneath it. I added prev/next buttons into the modals for navigating purpose.

@anselmh
Copy link
Contributor

anselmh commented Jun 18, 2014

You can use stacked modals for it with which it should work by default: https://github.com/drublic/css-modal/blob/master/modal.js#L210
Or you can call these methods manually listening to the custom events fired by CSS Modal.

Third option, if you use it to display images or similar things, there’s a gallery plugin in the plugins folder. This takes care of displaying a prev/next navigation and uses only one modal for the different contents.

Does that answer your question?

@robertfausk
Copy link

Am i able to prevent stacking of modals?
If yes, how can I do it. I didn't find anything in doc and issues about that. Only that stacking modals is enabled per default if it's used with javascript.

@hwaal
Copy link
Author

hwaal commented Jun 19, 2014

Exactly what Robertfausk says, I want to close the current modal when calling a new modal. So disable stacking of modals if possible?

@drublic drublic added this to the v1.2.0 milestone Jun 19, 2014
@drublic drublic changed the title Close current modal when calling another Disable stacking: Close current modal when calling another Jun 19, 2014
@drublic
Copy link
Owner

drublic commented Jun 20, 2014

Will look into it for 1.2.0. If you find the time and have the knowledge, I'd appreciate input on the implementation (data-attribute…).

@drublic drublic modified the milestones: v.1.3.0, v1.2.0 Nov 19, 2014
drublic added a commit that referenced this issue Nov 20, 2014
It is possible to not stack modals when opening them from another modal
now by applying a data attribute: `data-stackable="false"`.

This option is `true` by default.

Reference #146.
drublic added a commit that referenced this issue Nov 20, 2014
It is possible to not stack modals when opening them from another modal
now by applying a data attribute: `data-stackable="false"`.

This option is `true` by default.

Reference #146.
@drublic
Copy link
Owner

drublic commented Nov 20, 2014

Implementation done in #168. Please have a look.

@drublic drublic closed this as completed Dec 16, 2014
@drublic
Copy link
Owner

drublic commented Dec 16, 2014

Since it's done, i've closed this issue now.

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

No branches or pull requests

4 participants