yalabot / angular-foundation

http://pineconellc.github.io/angular-foundation/
Other
1.05k stars 267 forks source link

feat(modal): ability to change the parent container for modals #270

Closed orneryd closed 8 years ago

orneryd commented 8 years ago

We are currently in need of changing the target for the modal parent from body to another div.

I have added the functionality by adding the option "parent" to the modal options that by default is still 'body'

This also allows the users to use jquery selectors if they are including jquery. However, the test i wrote for it utilizes a pseudo-tag which should also work in jqlite. Existing functionality should remain backwards compatible while expanding options for those who need it.

jbrowning commented 8 years ago

Thanks @timothyswt. Could you expand a little bit on what the use case is for this? Failing to see why you would ever want your modal window to be appended to anything other than the body.

Also, if this is to be included, it needs to be documented for the demo site.

orneryd commented 8 years ago

The issue is when you want to scope the foundation CSS to a specific container rather than body. This is when you have multiple applications on a page or when you have, such as an enterprise organization, applications consuming other applications that do not have control over the body. it allows isolation of the css and prevents css styles from bleeding onto a page inadvertently. as of right now we have to "take over the page" with foundation which is not acceptable for our environment.

orneryd commented 8 years ago

Added a line in the readme.md for the new option. parent would be limited to element tags without including jQuery.

orneryd commented 8 years ago

Please let me know if this is going to be accepted. it is critical for our project here at GM and we have a tight deadline for OS project approvals. If it's not going to be accepted we will have to change directions completely.

jbrowning commented 8 years ago

LGTM. Thanks again @timothyswt.

orneryd commented 8 years ago

Thanks a lot Jeff!!!!!!