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

[modal] Add option to disable clicking the dimmer calling hideAll when allowMultiple = true #1438

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

Conversation

Merlin04
Copy link

Description

Add a new option, multipleHideAll, which when false makes clicking the dimmer when multiple modals have allowMultiple = true hide only the modal at the front. When true (the default) the previous behavior is used, i.e. hiding all of the open modals.

Testcase

I couldn't figure out how to create a testcase on JSFiddle but I tested it locally and it worked.

Closes

#1437

…All when allowMultiple = true

Add a new option, multipleHideAll, which when false makes clicking the dimmer when multiple modals
have allowMultiple = true hide only the modal at the front. When true (the default) the previous
behavior is used, i.e. hiding all of the open modals.

Closes fomantic#1437
@lubber-de
Copy link
Member

🤔 I am unsure, if your proposed solution is the way we should fix this. As you already pointed out (and as it is implemented for single modals already) the hideAll Method should check each of the other modals if its closable before hiding it via behaviors. (and should stop immediatly if one of them is not closable)

@lubber-de lubber-de added lang/javascript Anything involving JavaScript state/awaiting-reviews Pull requests which are waiting for reviews type/bug Any issue which is a bug or PR which fixes a bug labels Apr 25, 2020
@Merlin04
Copy link
Author

That sounds like a better way to do it. I'm trying to implement it but it seems like hideAll iterates over the modals from the one in the back, which would prevent this from working. Is there any reason it is done that way?

@lubber-de
Copy link
Member

Mmh, the current code reverses the found jquery modal elements to make sure it starts from the very top... Doesn't this work?

@Merlin04
Copy link
Author

It seems that it goes through them from the one furthest back, so I wouldn't be able to do the checking starting from the top.

@lubber-de lubber-de requested a review from ko2in June 9, 2020 10:05
@lubber-de lubber-de added state/on-hold Issues and pull requests which are on hold for any reason and removed state/awaiting-reviews Pull requests which are waiting for reviews labels Dec 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang/javascript Anything involving JavaScript state/on-hold Issues and pull requests which are on hold for any reason type/bug Any issue which is a bug or PR which fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants