From f2505eccf172915130dbed6bd92369a0e12a94d5 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Sun, 18 Sep 2016 19:22:40 +0200 Subject: [PATCH] update(dialog): remove .md-actions deprecation * Removes the `.md-actions` deprecation from pre- v1.0.0 * Simplifies the method to search for a close button Closes #9633 --- src/components/dialog/dialog.js | 19 +------------------ src/components/dialog/dialog.scss | 4 ++-- src/components/dialog/dialog.spec.js | 19 ------------------- 3 files changed, 3 insertions(+), 39 deletions(-) diff --git a/src/components/dialog/dialog.js b/src/components/dialog/dialog.js index 0420b91030..d65e7d0475 100644 --- a/src/components/dialog/dialog.js +++ b/src/components/dialog/dialog.js @@ -723,19 +723,9 @@ function MdDialogProvider($$interimElementProvider) { return dialogPopIn(element, options) .then(function() { lockScreenReader(element, options); - warnDeprecatedActions(); focusOnOpen(); }); - /** - * Check to see if they used the deprecated .md-actions class and log a warning - */ - function warnDeprecatedActions() { - if (element[0].querySelector('.md-actions')) { - $log.warn('Using a class of md-actions is deprecated, please use .'); - } - } - /** * For alerts, focus on content... otherwise focus on * the close button (or equivalent) @@ -753,14 +743,7 @@ function MdDialogProvider($$interimElementProvider) { * If we find no actions at all, log a warning to the console. */ function findCloseButton() { - var closeButton = element[0].querySelector('.dialog-close'); - - if (!closeButton) { - var actionButtons = element[0].querySelectorAll('.md-actions button, md-dialog-actions button'); - closeButton = actionButtons[actionButtons.length - 1]; - } - - return closeButton; + return element[0].querySelector('.dialog-close, md-dialog-actions button:last-child'); } } } diff --git a/src/components/dialog/dialog.scss b/src/components/dialog/dialog.scss index ed596e4501..e73f38b1b6 100644 --- a/src/components/dialog/dialog.scss +++ b/src/components/dialog/dialog.scss @@ -80,7 +80,7 @@ md-dialog { } } - .md-actions, md-dialog-actions { + md-dialog-actions { display: flex; order: 2; box-sizing: border-box; @@ -100,7 +100,7 @@ md-dialog { } } &.md-content-overflow { - .md-actions, md-dialog-actions { + md-dialog-actions { border-top-width: 1px; border-top-style: solid; } diff --git a/src/components/dialog/dialog.spec.js b/src/components/dialog/dialog.spec.js index 24772be9d2..474b6f562f 100644 --- a/src/components/dialog/dialog.spec.js +++ b/src/components/dialog/dialog.spec.js @@ -1197,25 +1197,6 @@ describe('$mdDialog', function() { expect($document.activeElement).toBe(parent[0].querySelector('#focus-target')); })); - it('should warn if the deprecated .md-actions class is used', inject(function($mdDialog, $rootScope, $log, $timeout) { - spyOn($log, 'warn'); - - var parent = angular.element('
'); - $mdDialog.show({ - template: - '' + - '
' + - '' + - '
' + - '
', - parent: parent - }); - - runAnimation(); - - expect($log.warn).toHaveBeenCalled(); - })); - it('should only allow one open at a time', inject(function($mdDialog, $rootScope, $animate) { var parent = angular.element('
'); $mdDialog.show({