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

Commit c32eaf1

Browse files
author
Cody Mikol
committed
fix (md-dialog)
Only append an md-theme attribute if the md-dialog is propagated from an element that contains an md-theme. Issue: #10276
1 parent da3c20e commit c32eaf1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/components/dialog/dialog.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,8 @@ function MdDialogProvider($$interimElementProvider) {
693693
var startSymbol = $interpolate.startSymbol();
694694
var endSymbol = $interpolate.endSymbol();
695695
var theme = startSymbol + (options.themeWatch ? '' : '::') + 'theme' + endSymbol;
696-
return '<div class="md-dialog-container" tabindex="-1" md-theme="' + theme + '">' + validatedTemplate(template) + '</div>';
696+
var themeAttr = (options.hasTheme) ? 'md-theme="'+theme+'"': '';
697+
return '<div class="md-dialog-container" tabindex="-1" ' + themeAttr + '>' + validatedTemplate(template) + '</div>';
697698

698699
/**
699700
* The specified template should contain a <md-dialog> wrapper element....
@@ -854,7 +855,9 @@ function MdDialogProvider($$interimElementProvider) {
854855

855856
var themeCtrl = targetEl && targetEl.controller('mdTheme');
856857

857-
if (!themeCtrl) {
858+
options.hasTheme = (!!themeCtrl);
859+
860+
if (!options.hasTheme) {
858861
return;
859862
}
860863

0 commit comments

Comments
 (0)