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

Commit

Permalink
fix(dialog): correct the opening position when opening from a button
Browse files Browse the repository at this point in the history
Closes #757. Closes #746.

Thanks @filod.
  • Loading branch information
ajoslin committed Nov 26, 2014
1 parent 4f59a28 commit 2286539
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/dialog/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -418,16 +418,16 @@ function MdDialogProvider($$interimElementProvider) {
if (clickElement) {
var clickRect = clickElement[0].getBoundingClientRect();
startPos = 'translate3d(' +
(clickRect.left - element[0].offsetWidth) + 'px,' +
(clickRect.top - element[0].offsetHeight) + 'px,' +
(clickRect.left - element[0].offsetWidth / 2) + 'px,' +
(clickRect.top - element[0].offsetHeight / 2) + 'px,' +
'0) scale(0.2)';
} else {
startPos = 'translate3d(0,100%,0) scale(0.5)';
}

element
.css($mdConstant.CSS.TRANSFORM, startPos)
.css('opacity', 0);
.css($mdConstant.CSS.TRANSFORM, startPos)
.css('opacity', 0);

$$rAF(function() {
$$rAF(function() {
Expand Down

0 comments on commit 2286539

Please sign in to comment.