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

Commit 9434120

Browse files
dozingcatThomasBurleson
authored andcommitted
fix(dialog): autoclose fixed and close animation shrinks to originating element poisition.
capture originating element and position, If targetEvent element is hidden when dialog closes, shrink to the element's original position. add tests to verify that the correct CSS transforms are set when expanding and shrinking. code refactor to fix listeners fix clickOutsideToClose escape keyup listeners to auto-close. Closes #3555. Fixes #3541. Fixes #2479.
1 parent 8c1ac53 commit 9434120

File tree

3 files changed

+383
-165
lines changed

3 files changed

+383
-165
lines changed

src/components/dialog/demoBasicUsage/script.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ angular.module('dialogDemo1', ['ngMaterial'])
1010
$mdDialog.show(
1111
$mdDialog.alert()
1212
.parent(angular.element(document.body))
13+
.clickOutsideToClose(true)
1314
.title('This is an alert title')
1415
.content('You can specify some description text in here.')
1516
.ariaLabel('Alert Dialog Demo')
@@ -21,13 +22,13 @@ angular.module('dialogDemo1', ['ngMaterial'])
2122
$scope.showConfirm = function(ev) {
2223
// Appending dialog to document.body to cover sidenav in docs app
2324
var confirm = $mdDialog.confirm()
24-
.parent(angular.element(document.body))
25-
.title('Would you like to delete your debt?')
26-
.content('All of the banks have agreed to forgive you your debts.')
27-
.ariaLabel('Lucky day')
28-
.ok('Please do it!')
29-
.cancel('Sounds like a scam')
30-
.targetEvent(ev);
25+
.parent(angular.element(document.body))
26+
.title('Would you like to delete your debt?')
27+
.content('All of the banks have agreed to forgive you your debts.')
28+
.ariaLabel('Lucky day')
29+
.ok('Please do it!')
30+
.cancel('Sounds like a scam')
31+
.targetEvent(ev);
3132

3233
$mdDialog.show(confirm).then(function() {
3334
$scope.alert = 'You decided to get rid of your debt.';

0 commit comments

Comments
 (0)