Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

feat(modal): Adds defaultContainer to $modalProvider #2942

Closed
wants to merge 2 commits into from

Conversation

Lalem001
Copy link

@Lalem001 Lalem001 commented Nov 7, 2014

Includes basic tests, with adjustments to toHaveModalsOpen and toHaveBackdrop.

Fixes: #2688

Includes basic tests, with adjustments to `toHaveModalsOpen` and
`toHaveBackdrop`
@chrisirhc
Copy link
Contributor

Excellent! Thanks! I don't have any cycles to review this at the moment, but if anyone would like to test it or review it, please go ahead.

@dubejf
Copy link

dubejf commented Nov 15, 2014

It would probably be better to add appendTo as a modalOptions instead of being a global setting on the $modalProvider.

Also, if you want to keep the $modalProvider.appendTo, it should be renamed to $modalProvider.defaultContainer.

Referenced as `container` on modal and modalWindow.
@Lalem001
Copy link
Author

Sorry for the delay.

$modalProvider.appendTo has been changed to $modalProvider.defaultContainer.

I am under the impression that this implementation was not built to handle modals on different containers, thus I believe adding appendTo to modalOptions would cause problems for some people. Support for modals on different containers could be done in the future if requested.

@Lalem001 Lalem001 changed the title feat(modal): Adds appendTo to $modalProvider feat(modal): Adds defaultContainer to $modalProvider Nov 24, 2014
@pepopowitz
Copy link

One issue I noticed is that you also moved the OPENED_MODAL_CLASS and backdrop element to the container element, instead of the body. When those are applied at the container, the user can scroll the modal off the screen, and the backdrop will not cover the entire screen if they had already scrolled.

I think the OPENED_MODAL_CLASS and backdrop element should remain on the body, rather than the container.

@Lalem001
Copy link
Author

Lalem001 commented Dec 5, 2014

@pleepleus88 I have not run into this issue in my environment, but I can see how it could happen in theory.

Perhaps it would be a good idea to rename defaultContainer to modalContainer, and add a backdropContainer attribute?

@pepopowitz
Copy link

That makes sense, and seems like it would work. 👍

@wesleycho
Copy link
Contributor

Can you update this with current master?

@Lalem001
Copy link
Author

Lalem001 commented Apr 6, 2015

I will close this one, and make a new PR with latest master. Will link to new PR here when its ready.

@Lalem001 Lalem001 closed this Apr 6, 2015
@Lalem001
Copy link
Author

Lalem001 commented Apr 6, 2015

@wesleycho Regarding the change suggested above with separate containers for modal and backdrop, how would you prefer it be done?

Like:

$modalProvider.modalContainer = body;
$modalProvider.backdropContainer = body;

Or:

$modalProvider.defaultContainers = {
    modal: body,
    backdrop: body
}

Other?

@chrisirhc
Copy link
Contributor

Fyi @Lalem001 , you can force push to the branch that this PR is based on to update it, so you don't need to create a new PR.

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

Successfully merging this pull request may close these issues.

appendTo option for modal dialog
6 participants