Skip to content

Commit 0388d84

Browse files
committed
fix(MdApp): fix persistent drawer not pushing the content
1 parent 7d86e8c commit 0388d84

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

src/components/MdApp/MdAppInternalDrawer.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="md-app md-app-internal-drawer md-layout-column" :class="appClasses">
33
<slot name="md-app-toolbar"></slot>
44

5-
<main class="md-app-container md-flex md-layout-row" :style="containerStyles" :class="[$mdActiveTheme, scrollerClasses]">
5+
<main class="md-app-container md-flex md-layout-row" :style="[containerStyles, contentStyles]" :class="[$mdActiveTheme, scrollerClasses]">
66
<slot name="md-app-drawer"></slot>
77
<div class="md-app-scroller md-layout-column md-flex" :class="[$mdActiveTheme, scrollerClasses]">
88
<slot name="md-app-content"></slot>

src/components/MdApp/MdAppMixin.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,19 @@ export default {
6565
}
6666
},
6767
computed: {
68-
containerStyles () {
69-
let styles = {}
70-
68+
contentStyles () {
7169
if (this.MdApp.drawer.active && this.MdApp.drawer.mode === 'persistent') {
72-
styles['padding-left'] = this.MdApp.drawer.width
70+
return {
71+
'padding-left': this.MdApp.drawer.width
72+
}
7373
}
74-
74+
},
75+
containerStyles () {
7576
if ((this.mdMode && this.mdMode !== 'fixed') || this.mdFlexible) {
76-
styles['margin-top'] = this.MdApp.toolbar.initialHeight + 'px'
77+
return {
78+
'margin-top': this.MdApp.toolbar.initialHeight + 'px'
79+
}
7780
}
78-
79-
return styles
8081
},
8182
scrollerClasses () {
8283
if (this.mdScrollbar) {
@@ -90,7 +91,8 @@ export default {
9091
'md-fixed': this.mdMode === 'fixed',
9192
'md-fixed-last': this.mdMode === 'fixed-last',
9293
'md-reveal': this.mdMode === 'reveal',
93-
'md-overlap': this.mdMode === 'overlap'
94+
'md-overlap': this.mdMode === 'overlap',
95+
'md-drawer-active': this.MdApp.drawer.active
9496
}
9597
}
9698
},
@@ -160,10 +162,8 @@ export default {
160162
if (firstRowHeight) {
161163
if (shouldKeepFlexible) {
162164
toolbar.style.height = scrollAmount + 'px'
163-
this.$emit('md-flexible-done')
164165
} else {
165166
toolbar.style.height = firstRowHeight + 'px'
166-
this.$emit('md-flexible-done')
167167
}
168168
}
169169

src/components/MdApp/MdAppSideDrawer.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<div class="md-app md-app-side-drawer md-layout-row" :class="appClasses">
33
<slot name="md-app-drawer"></slot>
44

5-
<main class="md-app-container md-flex md-layout-column" :class="[$mdActiveTheme, scrollerClasses]" :style="containerStyles" @scroll.passive="handleScroll">
5+
<main class="md-app-container md-flex md-layout-column" :class="[$mdActiveTheme, scrollerClasses]" :style="contentStyles" @scroll.passive="handleScroll">
66
<slot name="md-app-toolbar"></slot>
7-
<div class="md-app-scroller md-layout-column md-flex" :class="[$mdActiveTheme, scrollerClasses]" @scroll.passive="handleScroll">
7+
<div class="md-app-scroller md-layout-column md-flex" :class="[$mdActiveTheme, scrollerClasses]" :style="containerStyles" @scroll.passive="handleScroll">
88
<slot name="md-app-content"></slot>
99
</div>
1010
</main>

0 commit comments

Comments
 (0)