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

Commit

Permalink
fix(dialog): fix overlay not covering, dialog position in overlay
Browse files Browse the repository at this point in the history
references #908

closes #1287
  • Loading branch information
rschmukler committed Jan 26, 2015
1 parent 7965f59 commit 1d5ef95
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/components/backdrop/backdrop-theme.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
md-backdrop.md-opaque.md-THEME_NAME-theme {
background-color: '{{foreground-4-0.5}}';
position: absolute
}
8 changes: 5 additions & 3 deletions src/components/dialog/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,13 +329,15 @@ function MdDialogProvider($$interimElementProvider) {
configureAria(element.find('md-dialog'));

if (options.hasBackdrop) {
var parentOffset = options.parent.prop('scrollTop');
options.backdrop = angular.element('<md-backdrop class="md-dialog-backdrop md-opaque">');
$mdTheming.inherit(options.backdrop, options.parent);
$animate.enter(options.backdrop, options.parent);
element.css('top', parentOffset +'px');
}

if (options.disableParentScroll) {
options.oldOverflowStyle = options.parent.css('overflow');
options.lastOverflow = options.parent.css('overflow');
options.parent.css('overflow', 'hidden');
}

Expand Down Expand Up @@ -387,8 +389,8 @@ function MdDialogProvider($$interimElementProvider) {
$animate.leave(options.backdrop);
}
if (options.disableParentScroll) {
options.parent.css('overflow', options.oldOverflowStyle);
$document[0].removeEventListener('scroll', options.captureScroll, true);
options.parent.css('overflow', options.lastOverflow);
delete options.lastOverflow;
}
if (options.escapeToClose) {
$rootElement.off('keyup', options.rootElementKeyupCallback);
Expand Down
6 changes: 3 additions & 3 deletions src/components/dialog/dialog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
justify-content: center;
align-items: center;
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
z-index: $z-index-dialog;
}

Expand Down

0 comments on commit 1d5ef95

Please sign in to comment.