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

feat(modal): add container option #4599

Closed
wants to merge 1 commit into from
Closed

Conversation

aroop
Copy link
Contributor

@aroop aroop commented Oct 12, 2015

Allows modal to be added to any element instead of body. If container option is not passed modal will be added to body

@icfantv
Copy link
Contributor

icfantv commented Oct 13, 2015

@aroop, I'm a little confused as to what the advantage would be here and what you hope to accomplish.

@aroop
Copy link
Contributor Author

aroop commented Oct 13, 2015

@icfantv,

we used modals and little bit of CSS to build the following components

  • ASide - Similar to Aside component in AngularStrap project
  • FullScreenDialog - Dialog which take all the available screen size. Used in mobile views

One of the new requirements that we have for Aside panel is to make it slide from the edge of a DIV. This PR will allow the Aside model to the added to any HTML element in the DOM hierarchy.

@icfantv
Copy link
Contributor

icfantv commented Oct 13, 2015

Ok. I'll mark it as needs review, but I can't promise anything.

});

it('should not be added to body if container is passed', function() {
var subElement = '<div clas="details-panel"></div>';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo here. should be class.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed usage of class in testcases so that this PR won't give the impression that any element can be found.

@@ -19,6 +19,7 @@ The `$uibModal` service has only one method: `open(options)` where available opt
* `windowTemplateUrl` - a path to a template overriding modal's window template
* `size` - optional suffix of modal window class. The value used is appended to the `modal-` class, i.e. a value of `sm` gives `modal-sm`
* `openedClass` - class added to the `body` element when the modal is opened. Defaults to `modal-open`
* `container` - Appends the modal to a specific element. Example: container: 'body'. Defaults to `body` element.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we discussed below, please indicate that this must be an angular.element. So the onus is on the user to do the selector.

@wesleycho
Copy link
Contributor

Please clean up the history - there should not be any merge commit. Please use rebase instead.

May need to do
git checkout b7c56c2; git pull --rebase origin master, where origin is pointing to this repository.

@aroop
Copy link
Contributor Author

aroop commented Oct 26, 2015

This PR also fixes #2688 & #3686

feat(modal): add container option
@wesleycho
Copy link
Contributor

Changing api to be appendTo instead of container, but otherwise great work - merging shortly.

@georgehrke
Copy link

Hey,
I'm using angular ui bootstrap via bower. Any ETA when this feature will be released?
Thx 😊
Georg

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.

4 participants