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

Unify modal and dialog #128

Closed
lanterndev opened this issue Feb 9, 2013 · 11 comments
Closed

Unify modal and dialog #128

lanterndev opened this issue Feb 9, 2013 · 11 comments
Assignees

Comments

@lanterndev
Copy link
Contributor

The modal directive is currently only configurable with the two (undocumented) options backdrop and escape. The dialog service on the other hand accepts 11 different options (with different names) controlling similar and additional behavior:
https://github.com/angular-ui/bootstrap/blob/master/src/dialog/README.md#optionsopts
Can there be more overlap here?

@pkozlowski-opensource
Copy link
Member

+1 Definitively. Not only we need to unify config options but implementation as well (when appropriate).

@SidhNor
Copy link
Contributor

SidhNor commented Feb 12, 2013

I started working on the merge of modal and dialog on my fork.

@pkozlowski-opensource
Copy link
Member

@SidhNor awesome news! I guess making the modal directive depend on the $dialog service is a good move. I assume that you are going to take out child markup and use it as a template for the $dialog, right?

@SidhNor
Copy link
Contributor

SidhNor commented Feb 12, 2013

Exactly :)

@SidhNor
Copy link
Contributor

SidhNor commented Feb 12, 2013

Initial draft 329e8f8

@SidhNor
Copy link
Contributor

SidhNor commented Feb 14, 2013

I finished the initial merge.
It is available on the refact/dialogmodal branch
Compare view

@angular-ui/bootstrap,
Could you take a look if there are any areas you would like to see improved/changed.

Thanks

@pkozlowski-opensource
Copy link
Member

@SidhNor I had a quick look and it looks OK. Too tired to have deeper look but just 2 remarks for now:

  • Maybe we should keep the model directive in its folder and a separate file. This way we can have a separate documentation / example on the demo page?
  • Initially I thought that the modal directive will terminate compilation (terminal: true) and will take the child content as a template for the $dialog service. But once again, I need to to have a deep look at your impl.

Great stuff, keep up the good work!

@ghost ghost assigned SidhNor Feb 14, 2013
@SidhNor
Copy link
Contributor

SidhNor commented Feb 15, 2013

@pkozlowski-opensource,

  • Regarding separate folder - moved it back there. (Although it was showing a separate example on the demo page because the folder modal/docs still exists)
  • That was exactly what I did in the first draft, didn't know what got into me yesterday to do another spike. The first version is much better/cleaner. I've pushed it into the branch.

Again, changes can be seen here:
Compare view

@pkozlowski-opensource
Copy link
Member

@SidhNor Just had another look at the modal directive and it starts to look really good!

Just wonder if we this is the best strategy to hide the element (elm.css({'display':'none'});). Can't we simply remove it? I mean, at least it content? There is not reason to keep it around in the DOM, or is there?

@SidhNor
Copy link
Contributor

SidhNor commented Feb 15, 2013

@pkozlowski-opensource ,
Thanks Pawel, i've removed the element whatsoever. Seems to work fine, tests passing on Chrome, FF and Opera.
Should we merge then or is there something else?
Probably a more detailed doc update? Although having a link to $dialog readme seems enough.

@pkozlowski-opensource
Copy link
Member

@SidhNor seems really fine. Can you squash commits and open a PR so we can use code review of GH? I will have a couple of small remarks that I could just fix when merging but prefer to share my thoughts on GH.

Great work, BTW!

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

No branches or pull requests

3 participants