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

Commit

Permalink
fix(dialog): makes sure that body is not more than 100% height when d…
Browse files Browse the repository at this point in the history
…ialog is showing

This is a bit of a band-aid fix.  Ideally, we will need to add a bit of logic to position the dialog relative to body scroll position.
  • Loading branch information
Robert Messerle committed Apr 30, 2015
1 parent 2b6dd4d commit 6806f55
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/dialog/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ function MdDialogProvider($$interimElementProvider) {

// On show method for dialogs
function onShow(scope, element, options) {
angular.element($document[0].body).addClass('md-dialog-is-showing');
element = $mdUtil.extractElementByName(element, 'md-dialog');

// Incase the user provides a raw dom element, always wrap it in jqLite
Expand Down Expand Up @@ -504,6 +505,7 @@ function MdDialogProvider($$interimElementProvider) {

// On remove function for all dialogs
function onRemove(scope, element, options) {
angular.element($document[0].body).removeClass('md-dialog-is-showing');

if (options.backdrop) {
$animate.leave(options.backdrop);
Expand Down
3 changes: 3 additions & 0 deletions src/components/dialog/dialog.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.md-dialog-is-showing {
max-height: 100%;
}
.md-dialog-container {
display: flex;
justify-content: center;
Expand Down

0 comments on commit 6806f55

Please sign in to comment.