This repository was archived by the owner on Sep 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -31,10 +31,10 @@ <h2>Mango (Fruit)</h2>
31
31
More on Wikipedia
32
32
</ md-button >
33
33
< span flex > </ span >
34
- < md-button ng-click ="answer('not useful') " style =" margin-top:20px; " >
34
+ < md-button ng-click ="answer('not useful') ">
35
35
Not Useful
36
36
</ md-button >
37
- < md-button ng-click ="answer('useful') " style ="margin-top:20px;margin- right:20px; ">
37
+ < md-button ng-click ="answer('useful') " style ="margin-right:20px; ">
38
38
Useful
39
39
</ md-button >
40
40
</ div >
Original file line number Diff line number Diff line change @@ -9,15 +9,23 @@ angular.module('material.components.dialog', [
9
9
. directive ( 'mdDialog' , MdDialogDirective )
10
10
. provider ( '$mdDialog' , MdDialogProvider ) ;
11
11
12
- function MdDialogDirective ( $$rAF , $mdTheming ) {
12
+ function MdDialogDirective ( $$rAF , $mdTheming , $timeout ) {
13
13
return {
14
14
restrict : 'E' ,
15
15
link : function ( scope , element , attr ) {
16
16
$mdTheming ( element ) ;
17
17
$$rAF ( function ( ) {
18
+ var images ;
18
19
var content = element [ 0 ] . querySelector ( 'md-dialog-content' ) ;
19
- if ( content && content . scrollHeight >= content . clientHeight ) {
20
- element . addClass ( 'md-content-overflow' ) ;
20
+
21
+ if ( content ) {
22
+ images = content . getElementsByTagName ( 'img' ) ;
23
+ addOverflowClass ( ) ;
24
+ //-- delayed image loading may impact scroll height, check after images are loaded
25
+ angular . element ( images ) . on ( 'load' , addOverflowClass ) ;
26
+ }
27
+ function addOverflowClass ( ) {
28
+ element . toggleClass ( 'md-content-overflow' , content . scrollHeight > content . clientHeight ) ;
21
29
}
22
30
} ) ;
23
31
}
You can’t perform that action at this time.
0 commit comments