File tree Expand file tree Collapse file tree 2 files changed +14
-13
lines changed Expand file tree Collapse file tree 2 files changed +14
-13
lines changed Original file line number Diff line number Diff line change @@ -194,6 +194,7 @@ $card-radius: 2px;
194
194
}
195
195
}
196
196
197
+
197
198
.md-card-actions {
198
199
padding : 8px ;
199
200
display : flex ;
@@ -285,6 +286,8 @@ $card-radius: 2px;
285
286
.md-card-content {
286
287
margin-top : 0 !important ;
287
288
opacity : 1 ;
289
+ padding : 4px 16px 24px 16px ;
290
+ height : auto ;
288
291
}
289
292
}
290
293
@@ -300,13 +303,14 @@ $card-radius: 2px;
300
303
}
301
304
302
305
.md-card-content {
303
- padding-top : 4px ;
306
+ height : 0 ;
307
+ padding : 0 16px ;
304
308
position : relative ;
305
309
z-index : 1 ;
306
310
opacity : 0 ;
307
311
transform : translate3D (0 , 0 , 0 );
308
312
transition : $swift-ease-out ;
309
- will-change : margin ;
313
+ will-change : margin , height ;
310
314
}
311
315
}
312
316
}
Original file line number Diff line number Diff line change 1
1
<template >
2
- <div class =" md-card-expand" ref =" expand" >
2
+ <div class =" md-card-expand"
3
+ ref =" expand" >
3
4
<slot ></slot >
4
5
</div >
5
6
</template >
6
7
7
8
<script >
8
9
export default {
9
10
name: ' md-card-expand' ,
11
+ data () {
12
+ return {
13
+ trigger: null ,
14
+ content: null
15
+ };
16
+ },
10
17
methods: {
11
- setContentMargin () {
12
- this .content .style .marginTop = - this .content .offsetHeight + ' px' ;
13
- },
14
18
toggle () {
15
19
this .$refs .expand .classList .toggle (' md-active' );
16
- },
17
- onWindowResize () {
18
- window .requestAnimationFrame (this .setContentMargin );
19
20
}
20
21
},
21
22
mounted () {
24
25
this .content = this .$el .querySelector (' .md-card-content' );
25
26
26
27
if (this .content ) {
27
- this .setContentMargin ();
28
-
29
28
this .trigger .addEventListener (' click' , this .toggle );
30
- window .addEventListener (' resize' , this .onWindowResize );
31
29
}
32
30
}, 200 );
33
31
},
34
32
destroyed () {
35
33
if (this .content ) {
36
34
this .trigger .removeEventListener (' click' , this .toggle );
37
- window .removeEventListener (' resize' , this .onWindowResize );
38
35
}
39
36
}
40
37
};
You can’t perform that action at this time.
0 commit comments