Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
Merlin04 wants to merge 1 commit intofomantic:developfrom
Merlin04:multiple-modals-closable-option
Open

[modal] Add option to disable clicking the dimmer calling hideAll when allowMultiple = true#1438
Merlin04 wants to merge 1 commit intofomantic:developfrom
Merlin04:multiple-modals-closable-option

Conversation

Copy link

Merlin04 commented Apr 25, 2020

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
auto-assign bot requested review from ColinFrick, exoego, lubber-de, prudho and y0hami April 25, 2020 21:15
Copy link
Member

lubber-de commented Apr 25, 2020

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 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
Copy link
Author

Merlin04 commented Apr 25, 2020

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?

Copy link
Member

lubber-de commented Apr 26, 2020

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

Copy link
Author

Merlin04 commented Apr 26, 2020

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 requested a review from ko2in June 9, 2020 10:05
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

Reviewers

ColinFrick Awaiting requested review from ColinFrick

exoego Awaiting requested review from exoego

y0hami Awaiting requested review from y0hami

lubber-de Awaiting requested review from lubber-de

prudho Awaiting requested review from prudho

ko2in Awaiting requested review from ko2in

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

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

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants