From c19feef857fdb1d369addb56f750b7fa22060153 Mon Sep 17 00:00:00 2001 From: Marcy Sutton Date: Mon, 4 May 2015 16:37:37 -0700 Subject: [PATCH] fix(dialog): BREAKING CHANGE rename to md-actions `
` is now deprecated. Dialogs and cards should use `` for including action buttons. --- docs/app/partials/view-source.tmpl.html | 4 ++-- src/components/card/card.js | 6 ++--- src/components/card/card.scss | 2 +- src/components/card/demoBasicUsage/index.html | 4 ++-- .../dialog/demoBasicUsage/dialog1.tmpl.html | 4 ++-- src/components/dialog/dialog-theme.scss | 2 +- src/components/dialog/dialog.js | 16 +++++++------- src/components/dialog/dialog.scss | 4 ++-- src/components/dialog/dialog.spec.js | 22 +++++++++---------- 9 files changed, 32 insertions(+), 32 deletions(-) diff --git a/docs/app/partials/view-source.tmpl.html b/docs/app/partials/view-source.tmpl.html index f3343bfdd27..3d633d20494 100644 --- a/docs/app/partials/view-source.tmpl.html +++ b/docs/app/partials/view-source.tmpl.html @@ -17,9 +17,9 @@
-
+ Done -
+ diff --git a/src/components/card/card.js b/src/components/card/card.js index 924ba38d87d..a3bf335f0b5 100644 --- a/src/components/card/card.js +++ b/src/components/card/card.js @@ -26,7 +26,7 @@ angular.module('material.components.card', [ * container will wrap text content and provide padding. An `` element can be * optionally included to put content flush against the bottom edge of the card. * - * Action buttons can be included in an element with the `.md-actions` class, also used in `md-dialog`. + * Action buttons can be included in an element with the `md-actions` element, also used in `md-dialog`. * You can then position buttons using layout attributes. * * Cards have constant width and variable heights; where the maximum height is limited to what can @@ -55,10 +55,10 @@ angular.module('material.components.card', [ *

Card headline

*

Card content

* - *
+ * * Action 1 * Action 2 - *
+ * * * * diff --git a/src/components/card/card.scss b/src/components/card/card.scss index d1114a76fba..a811adf7311 100644 --- a/src/components/card/card.scss +++ b/src/components/card/card.scss @@ -17,7 +17,7 @@ md-card { md-card-content { padding: $card-padding; } - .md-actions { + md-actions { margin: 0; .md-button { diff --git a/src/components/card/demoBasicUsage/index.html b/src/components/card/demoBasicUsage/index.html index f5b7b488189..215a9e1aea2 100644 --- a/src/components/card/demoBasicUsage/index.html +++ b/src/components/card/demoBasicUsage/index.html @@ -12,10 +12,10 @@

Paracosm

two most important words in Ernest Greene's musical language: feel it. It's a simple request, as well...

-
+ Action 1 Action 2 -
+ diff --git a/src/components/dialog/demoBasicUsage/dialog1.tmpl.html b/src/components/dialog/demoBasicUsage/dialog1.tmpl.html index b4156422521..765652f2f12 100644 --- a/src/components/dialog/demoBasicUsage/dialog1.tmpl.html +++ b/src/components/dialog/demoBasicUsage/dialog1.tmpl.html @@ -18,8 +18,8 @@ -
+ More on Wikipedia @@ -29,6 +29,6 @@ Useful -
+ diff --git a/src/components/dialog/dialog-theme.scss b/src/components/dialog/dialog-theme.scss index 77edfdeae3d..5bf73ae5103 100644 --- a/src/components/dialog/dialog-theme.scss +++ b/src/components/dialog/dialog-theme.scss @@ -4,7 +4,7 @@ md-dialog.md-THEME_NAME-theme { border-radius: $dialog-border-radius; background-color: '{{background-color}}'; - &.md-content-overflow .md-actions { + &.md-content-overflow md-actions { border-top-color: '{{foreground-4}}'; } } diff --git a/src/components/dialog/dialog.js b/src/components/dialog/dialog.js index 3d2e8ae8e45..75075e59b68 100644 --- a/src/components/dialog/dialog.js +++ b/src/components/dialog/dialog.js @@ -39,7 +39,7 @@ function MdDialogDirective($$rAF, $mdTheming) { * - The dialog is always given an isolate scope. * - The dialog's template must have an outer `` element. * Inside, use an `` element for the dialog's content, and use - * an element with class `md-actions` for the dialog's actions. + * an `md-actions` element for the dialog's actions. * - Dialogs must cover the entire application to keep interactions inside of them. * Use the `parent` option to change where dialogs are appended. * @@ -117,11 +117,11 @@ function MdDialogDirective($$rAF, $mdTheming) { * ' '+ * ' '+ * ' ' + - * '
' + + * ' ' + * ' ' + * ' Close Dialog' + * ' ' + - * '
' + + * ' ' + * '
', * locals: { * items: $scope.items @@ -196,11 +196,11 @@ function MdDialogDirective($$rAF, $mdTheming) { * * ' Hello {{ employee }}!' + * - * '
' + + * ' ' + * ' ' + * ' Close Greeting' + * ' ' + - * '
' + + * ' ' + * '', * controller: 'GreetingController', * onComplete: afterShowAnimation, @@ -365,7 +365,7 @@ function MdDialogProvider($$interimElementProvider) { '

{{ dialog.title }}

', '

{{ dialog.content }}

', '', - '
', + '', '', '{{ dialog.cancel }}', @@ -373,7 +373,7 @@ function MdDialogProvider($$interimElementProvider) { '', '{{ dialog.ok }}', '', - '
', + '', '' ].join(''), controller: function mdDialogCtrl() { @@ -495,7 +495,7 @@ function MdDialogProvider($$interimElementProvider) { //button child in md-actions and assume it is a close button var closeButton = element[0].querySelector('.dialog-close'); if (!closeButton) { - var actionButtons = element[0].querySelectorAll('.md-actions button'); + var actionButtons = element[0].querySelectorAll('md-actions button'); closeButton = actionButtons[ actionButtons.length - 1 ]; } return angular.element(closeButton); diff --git a/src/components/dialog/dialog.scss b/src/components/dialog/dialog.scss index 9eea5815f4c..3ddc74c50cc 100644 --- a/src/components/dialog/dialog.scss +++ b/src/components/dialog/dialog.scss @@ -69,7 +69,7 @@ md-dialog { } } - .md-actions { + md-actions { display: flex; order: 2; box-sizing: border-box; @@ -89,7 +89,7 @@ md-dialog { margin-top: $baseline-grid; } } - &.md-content-overflow .md-actions { + &.md-content-overflow md-actions { border-top: 1px solid; } diff --git a/src/components/dialog/dialog.spec.js b/src/components/dialog/dialog.spec.js index 078f3e82f63..655fa1c5361 100644 --- a/src/components/dialog/dialog.spec.js +++ b/src/components/dialog/dialog.spec.js @@ -156,10 +156,10 @@ describe('$mdDialog', function() { $mdDialog.show({ template: '' + - '
' + + '' + '' + - '
' + - '
', + '' + + '', parent: parent }); @@ -365,10 +365,10 @@ describe('$mdDialog', function() { parent: parent, template: '' + - '
' + + '' + '
' + + '' + '
' }); @@ -393,10 +393,10 @@ describe('$mdDialog', function() { parent: parent, template: '' + - '
' + + '' + '
' + + '' + '
', }); @@ -419,10 +419,10 @@ describe('$mdDialog', function() { $mdDialog.show({ template: '' + - '
' + + '' + '
' + + '' + '
', parent: parent }); @@ -598,7 +598,7 @@ describe('$mdDialog with custom interpolation symbols', function() { var mdContent = mdDialog.find('md-dialog-content'); var title = mdContent.find('h2'); var content = mdContent.find('p'); - var mdActions = angular.element(mdDialog[0].querySelector('.md-actions')); + var mdActions = angular.element(mdDialog[0].querySelector('md-actions')); var buttons = mdActions.find('md-button'); expect(mdDialog.attr('aria-label')).toBe('test alert'); @@ -625,7 +625,7 @@ describe('$mdDialog with custom interpolation symbols', function() { var mdContent = mdDialog.find('md-dialog-content'); var title = mdContent.find('h2'); var content = mdContent.find('p'); - var mdActions = angular.element(mdDialog[0].querySelector('.md-actions')); + var mdActions = angular.element(mdDialog[0].querySelector('md-actions')); var buttons = mdActions.find('md-button'); expect(mdDialog.attr('aria-label')).toBe('test alert');