Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

fix(dialog): enable support for html content in dialogs #4148

Closed
wants to merge 1 commit into from

Conversation

ThomasBurleson
Copy link
Contributor

Enable support to specify HTML content for alert and confirm dialogs.

  • dialog::onShow( ) now uses wrapSimpleContent( ) to wrap simple strings in <p> tags
  • dialog basic demo showConfirm( ) uses HTML span tag to illustrate use of HMTL content
  • implemented generic md-template to safely inject HTML content into an element

BREAKING CHANGE: dialog content text is now injected into div.md-dialog-content-body

Before the template used was:

<md-dialog-content>
   <h2></h2>
   <p></p>
</md-dialog-content>

Now uses:

<md-dialog-content>
   <h2></h2>
   <div class="md-dialog-content-body">
     <p></p>
    </div>
</md-dialog-content>

Fixes #1495.

@ThomasBurleson ThomasBurleson added the needs: review This PR is waiting on review from the team label Aug 14, 2015
@ThomasBurleson ThomasBurleson added this to the 0.11.0 milestone Aug 14, 2015
@ThomasBurleson
Copy link
Contributor Author

@jelbourn, @robertmesserle - ready for review.

@@ -6,7 +6,6 @@ angular.module('material.components.dialog', [
'material.core',
'material.components.backdrop'
])
.directive('mdDialog', MdDialogDirective)
Copy link
Contributor

Choose a reason for hiding this comment

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

just kidding.

@epelc
Copy link
Contributor

epelc commented Aug 14, 2015

@ThomasBurleson any reason for the -body on the end of md-dialog-content? Seems a bit verbose.
We have a parent container md-dialog-content

<md-dialog-content >
  <h2 class="md-title"></h2>
  <div class="md-dialog-content-body" ></div>,
</md-dialog-content>

@@ -436,7 +435,7 @@ function MdDialogProvider($$interimElementProvider) {
}

/* @ngInject */
function dialogDefaultOptions($mdDialog, $mdAria, $mdUtil, $mdConstant, $animate, $document, $window, $rootElement) {
function dialogDefaultOptions($mdDialog, $mdAria, $mdUtil, $mdConstant, $animate, $document, $window, $rootElement ) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Soon, clang will clean up that trailing space! Otherwise, I would complain.

@ThomasBurleson ThomasBurleson modified the milestone: 0.11.0 Aug 14, 2015
@naomiblack naomiblack modified the milestones: 0.12.0, 0.11.0 Aug 14, 2015
ThomasBurleson added a commit that referenced this pull request Aug 14, 2015
…alogs

*  dialog`::onShow( )` now uses `wrapSimpleContent( )` to wrap simple strings in `<p>` tags
*  dialog basic demo `showConfirm( )` uses HTML span tag to illustrate use of HMTL content
*  implemented generic `md-template` to safely inject HTML content into an element

BREAKING CHANGE: dialog content text is now injected into **div.md-dialog-content-body**

Before the template used was:

```html
<md-dialog-content>
   <h2></h2>
   <p></p>
</md-dialog-content>
```

Now uses:

```html
<md-dialog-content>
   <h2></h2>
   <div class="md-dialog-content-body">
     <p></p>
    </div>
</md-dialog-content>
```

Fixes #1495. Closes #4148.
@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.

…alogs

*  dialog`::onShow( )` now uses `wrapSimpleContent( )` to wrap simple strings in `<p>` tags
*  dialog basic demo `showConfirm( )` uses HTML span tag to illustrate use of HMTL content
*  implemented generic `md-template` to safely inject HTML content into an element

BREAKING CHANGE: dialog content text is now injected into **div.md-dialog-content-body**

Before the template used was:

```html
<md-dialog-content>
   <h2></h2>
   <p></p>
</md-dialog-content>
```

Now uses:

```html
<md-dialog-content>
   <h2></h2>
   <div class="md-dialog-content-body">
     <p></p>
    </div>
</md-dialog-content>
```

Fixes #1495.
@googlebot
Copy link

CLAs look good, thanks!

@ThomasBurleson ThomasBurleson removed the needs: review This PR is waiting on review from the team label Aug 15, 2015
@ThomasBurleson
Copy link
Contributor Author

Closed with SHA 81e94b4

@EladBezalel EladBezalel deleted the wip/dialog_html_content branch January 16, 2016 00:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants