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

Commit 2c286b4

Browse files
devversionkara
authored andcommitted
update(dialog): remove .md-actions deprecation (#9637)
* Removes the `.md-actions` deprecation from pre- v1.0.0 * Simplifies the method to search for a close button Closes #9633
1 parent 1e4ba35 commit 2c286b4

File tree

3 files changed

+3
-39
lines changed

3 files changed

+3
-39
lines changed

src/components/dialog/dialog.js

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -725,19 +725,9 @@ function MdDialogProvider($$interimElementProvider) {
725725
return dialogPopIn(element, options)
726726
.then(function() {
727727
lockScreenReader(element, options);
728-
warnDeprecatedActions();
729728
focusOnOpen();
730729
});
731730

732-
/**
733-
* Check to see if they used the deprecated .md-actions class and log a warning
734-
*/
735-
function warnDeprecatedActions() {
736-
if (element[0].querySelector('.md-actions')) {
737-
$log.warn('Using a class of md-actions is deprecated, please use <md-dialog-actions>.');
738-
}
739-
}
740-
741731
/**
742732
* For alerts, focus on content... otherwise focus on
743733
* the close button (or equivalent)
@@ -755,14 +745,7 @@ function MdDialogProvider($$interimElementProvider) {
755745
* If we find no actions at all, log a warning to the console.
756746
*/
757747
function findCloseButton() {
758-
var closeButton = element[0].querySelector('.dialog-close');
759-
760-
if (!closeButton) {
761-
var actionButtons = element[0].querySelectorAll('.md-actions button, md-dialog-actions button');
762-
closeButton = actionButtons[actionButtons.length - 1];
763-
}
764-
765-
return closeButton;
748+
return element[0].querySelector('.dialog-close, md-dialog-actions button:last-child');
766749
}
767750
}
768751
}

src/components/dialog/dialog.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ md-dialog {
8080
}
8181
}
8282

83-
.md-actions, md-dialog-actions {
83+
md-dialog-actions {
8484
display: flex;
8585
order: 2;
8686
box-sizing: border-box;
@@ -100,7 +100,7 @@ md-dialog {
100100
}
101101
}
102102
&.md-content-overflow {
103-
.md-actions, md-dialog-actions {
103+
md-dialog-actions {
104104
border-top-width: 1px;
105105
border-top-style: solid;
106106
}

src/components/dialog/dialog.spec.js

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,25 +1197,6 @@ describe('$mdDialog', function() {
11971197
expect($document.activeElement).toBe(parent[0].querySelector('#focus-target'));
11981198
}));
11991199

1200-
it('should warn if the deprecated .md-actions class is used', inject(function($mdDialog, $rootScope, $log, $timeout) {
1201-
spyOn($log, 'warn');
1202-
1203-
var parent = angular.element('<div>');
1204-
$mdDialog.show({
1205-
template:
1206-
'<md-dialog>' +
1207-
'<div class="md-actions">' +
1208-
'<button class="md-button">Ok good</button>' +
1209-
'</div>' +
1210-
'</md-dialog>',
1211-
parent: parent
1212-
});
1213-
1214-
runAnimation();
1215-
1216-
expect($log.warn).toHaveBeenCalled();
1217-
}));
1218-
12191200
it('should only allow one open at a time', inject(function($mdDialog, $rootScope, $animate) {
12201201
var parent = angular.element('<div>');
12211202
$mdDialog.show({

0 commit comments

Comments
 (0)