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

Commit

Permalink
fix(dialog): incorrect dialog placement if page is scrolled
Browse files Browse the repository at this point in the history
closes #4115
  • Loading branch information
rschmukler committed Sep 16, 2015
1 parent 9e814c9 commit 1fc7622
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/dialog/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -755,10 +755,11 @@ function MdDialogProvider($$interimElementProvider) {

var isFixed = $window.getComputedStyle($document[0].body).position == 'fixed';
var backdrop = options.backdrop ? $window.getComputedStyle(options.backdrop[0]) : null;
var height = backdrop ? Math.ceil(Math.abs(parseInt(backdrop.height, 10))) : 0;

var height = backdrop ? Math.min($document[0].body.clientHeight, Math.ceil(Math.abs(parseInt(backdrop.height, 10)))) : 0;

container.css({
top: (isFixed ? $mdUtil.scrollTop(options.parent) / 2 : 0) + 'px',
top: (isFixed ? $mdUtil.scrollTop(options.parent) : 0) + 'px',
height: height ? height + 'px' : '100%'
});

Expand Down

0 comments on commit 1fc7622

Please sign in to comment.