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

Commit

Permalink
fix(dialog): autoclose fixed and close animation shrinks to originati…
Browse files Browse the repository at this point in the history
…ng 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.
  • Loading branch information
dozingcat authored and ThomasBurleson committed Jul 5, 2015
1 parent 8c1ac53 commit 9434120
Show file tree
Hide file tree
Showing 3 changed files with 383 additions and 165 deletions.
15 changes: 8 additions & 7 deletions src/components/dialog/demoBasicUsage/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ angular.module('dialogDemo1', ['ngMaterial'])
$mdDialog.show(
$mdDialog.alert()
.parent(angular.element(document.body))
.clickOutsideToClose(true)
.title('This is an alert title')
.content('You can specify some description text in here.')
.ariaLabel('Alert Dialog Demo')
Expand All @@ -21,13 +22,13 @@ angular.module('dialogDemo1', ['ngMaterial'])
$scope.showConfirm = function(ev) {
// Appending dialog to document.body to cover sidenav in docs app
var confirm = $mdDialog.confirm()
.parent(angular.element(document.body))
.title('Would you like to delete your debt?')
.content('All of the banks have agreed to forgive you your debts.')
.ariaLabel('Lucky day')
.ok('Please do it!')
.cancel('Sounds like a scam')
.targetEvent(ev);
.parent(angular.element(document.body))
.title('Would you like to delete your debt?')
.content('All of the banks have agreed to forgive you your debts.')
.ariaLabel('Lucky day')
.ok('Please do it!')
.cancel('Sounds like a scam')
.targetEvent(ev);

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

0 comments on commit 9434120

Please sign in to comment.