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

Commit 2286539

Browse files
committed
fix(dialog): correct the opening position when opening from a button
Closes #757. Closes #746. Thanks @filod.
1 parent 4f59a28 commit 2286539

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/components/dialog/dialog.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -418,16 +418,16 @@ function MdDialogProvider($$interimElementProvider) {
418418
if (clickElement) {
419419
var clickRect = clickElement[0].getBoundingClientRect();
420420
startPos = 'translate3d(' +
421-
(clickRect.left - element[0].offsetWidth) + 'px,' +
422-
(clickRect.top - element[0].offsetHeight) + 'px,' +
421+
(clickRect.left - element[0].offsetWidth / 2) + 'px,' +
422+
(clickRect.top - element[0].offsetHeight / 2) + 'px,' +
423423
'0) scale(0.2)';
424424
} else {
425425
startPos = 'translate3d(0,100%,0) scale(0.5)';
426426
}
427427

428428
element
429-
.css($mdConstant.CSS.TRANSFORM, startPos)
430-
.css('opacity', 0);
429+
.css($mdConstant.CSS.TRANSFORM, startPos)
430+
.css('opacity', 0);
431431

432432
$$rAF(function() {
433433
$$rAF(function() {

0 commit comments

Comments
 (0)