Skip to content

Commit

Permalink
MDL-61135 javascript: fix modal body height resizing when loading
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanwyllie committed Feb 2, 2018
1 parent a4f914b commit 2328bcc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/amd/build/modal.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion lib/amd/src/modal.js
Expand Up @@ -272,7 +272,12 @@ define(['jquery', 'core/templates', 'core/notification', 'core/key_codes',
if (value.state() == 'pending') {
// We're still waiting for the body promise to resolve so
// let's show a loading icon.
body.animate({height: '100px'}, 150);
var height = body.innerHeight();
if (height < 100) {
height = 100;
}

body.animate({height: height + 'px'}, 150);

body.html('');
contentPromise = Templates.render(TEMPLATES.LOADING, {})
Expand Down

0 comments on commit 2328bcc

Please sign in to comment.