Skip to content

Commit 4d3ce90

Browse files
pdanpdanrstoenescu
authored andcommitted
QLayout: fixes for container (quasarframework#2452)
* QLayout: fixes for container * Update QLayoutDrawer.js
1 parent c54d4e6 commit 4d3ce90

File tree

5 files changed

+62
-20
lines changed

5 files changed

+62
-20
lines changed

dev/components/components/layout-container.vue

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,57 @@
5353
</q-page-container>
5454
</q-layout>
5555

56+
<q-layout view="Lhh lpR fff" container style="height: 500px; width: 900px" class="q-mt-xl shadow-2">
57+
<q-layout-header reveal>
58+
<q-toolbar>
59+
<q-btn flat @click="drawer3 = !drawer3" round dense icon="menu" />
60+
<q-toolbar-title>Header</q-toolbar-title>
61+
<q-btn flat @click="drawer3R = !drawer3R" round dense icon="menu" />
62+
</q-toolbar>
63+
</q-layout-header>
64+
65+
<q-layout-footer reveal>
66+
<q-toolbar>
67+
<q-btn flat @click="drawer3 = !drawer3" round dense icon="menu" />
68+
<q-toolbar-title>Footer</q-toolbar-title>
69+
<q-btn flat @click="drawer3R = !drawer3R" round dense icon="menu" />
70+
</q-toolbar>
71+
</q-layout-footer>
72+
73+
<q-layout-drawer v-model="drawer3" :width="200" :breakpoint="300">
74+
<div v-for="n in 50" :key="n">Drawer {{ n }} / 50</div>
75+
</q-layout-drawer>
76+
<q-layout-drawer side="right" v-model="drawer3R" :width="200" :breakpoint="300">
77+
<div v-for="n in 50" :key="n">Drawer {{ n }} / 50</div>
78+
</q-layout-drawer>
79+
<q-page-container>
80+
<q-page style="padding-top: 50px" class="bg-yellow">
81+
<div v-for="n in contentSize" :key="n">My page My page My page My page My page My page My page My page My page {{ n }} / {{ contentSize }}</div>
82+
83+
<q-page-sticky position="top-left" :offset="[18, 58]">
84+
<q-btn round color="primary" icon="arrow_back" class="rotate-45" />
85+
</q-page-sticky>
86+
<q-page-sticky position="top-right" :offset="[18, 58]">
87+
<q-btn round color="primary" icon="arrow_upward" class="rotate-45" />
88+
</q-page-sticky>
89+
<q-page-sticky position="bottom-left" :offset="[18, 18]">
90+
<q-btn round color="primary" icon="arrow_forward" class="rotate-135" />
91+
</q-page-sticky>
92+
<q-page-sticky position="bottom-right" :offset="[18, 18]">
93+
<q-btn round color="primary" icon="arrow_forward" class="rotate-45" />
94+
</q-page-sticky>
95+
96+
<q-page-sticky position="top" expand>
97+
<q-toolbar>
98+
<q-btn flat round dense icon="map" />
99+
<q-toolbar-title>Title</q-toolbar-title>
100+
<q-checkbox color="white" v-model="moreContent" label="Scroll" />
101+
</q-toolbar>
102+
</q-page-sticky>
103+
</q-page>
104+
</q-page-container>
105+
</q-layout>
106+
56107
<q-modal v-model="modal" no-backdrop-dismiss>
57108
<q-layout view="LHh lpR fff" container style="min-height: 60vh; min-width: 60vw;">
58109
<q-layout-header reveal>
@@ -119,9 +170,11 @@ export default {
119170
return {
120171
modal: false,
121172
drawer: false,
122-
drawerR: false,
173+
drawerR: true,
123174
drawer2: false,
124-
drawer2R: false,
175+
drawer2R: true,
176+
drawer3: false,
177+
drawer3R: true,
125178
moreContent: true
126179
}
127180
},

dev/components/new-layout/new-layout.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@
220220
<transition enter-active-class="animated fadeIn" leave-active-class="animated fadeOut" mode="out-in">
221221
<router-view />
222222
</transition>
223-
<div class="fixed-bottom-right bg-grey-5 q-pa-sm z-max" style="bottom: 8px; right: 8px;">
223+
<div class="fixed-bottom-right bg-grey-5 q-pa-sm z-max" style="bottom: 8px; right: 8px; left: auto;">
224224
<q-toggle v-model="showConfig" label="Config" />
225225
</div>
226226
</q-page-container>

src/components/layout/QLayoutDrawer.js

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export default {
7272
}
7373
},
7474
watch: {
75-
belowBreakpoint (val, old) {
75+
belowBreakpoint (val) {
7676
if (this.mobileOpened) {
7777
return
7878
}
@@ -240,8 +240,7 @@ export default {
240240
`q-layout-drawer-${this.side}`,
241241
this.layout.container ? 'overflow-auto' : 'scroll',
242242
this.contentClass,
243-
this.mobileView ? this.belowClass : this.aboveClass,
244-
this.layout.container && !this.showing ? 'q-layout-drawer-invisible' : ''
243+
this.mobileView ? this.belowClass : this.aboveClass
245244
]
246245
},
247246
stateDirection () {
@@ -264,16 +263,14 @@ export default {
264263
applyPosition (position) {
265264
if (position === void 0) {
266265
this.$nextTick(() => {
267-
position = this.showing
268-
? (this.layout.container ? this.layout.scrollbarWidth : 0)
269-
: this.size
266+
position = this.showing ? 0 : this.size
270267

271268
this.applyPosition(this.stateDirection * position)
272269
})
273270
}
274271
else if (this.$refs.content) {
275-
if (this.layout.container && this.mobileView && this.rightSide && position === 0) {
276-
position = this.stateDirection * this.layout.scrollbarWidth
272+
if (this.layout.container && this.rightSide && (this.mobileView || Math.abs(position) === this.size)) {
273+
position += this.stateDirection * this.layout.scrollbarWidth
277274
}
278275
css(this.$refs.content, cssTransform(`translateX(${position}px)`))
279276
}
@@ -430,9 +427,7 @@ export default {
430427
this.__update('offset', this.offset)
431428
},
432429
mounted () {
433-
if (this.showing) {
434-
this.applyPosition(0)
435-
}
430+
this.applyPosition(this.showing ? 0 : void 0)
436431
},
437432
beforeDestroy () {
438433
clearTimeout(this.timer)

src/components/layout/layout.ios.styl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ $layout-transition = all .12s ease-in
3131
z-index $z-side
3232
&.on-top
3333
z-index $z-fixed-drawer
34-
.q-layout-drawer-invisible:not(.no-transition)
35-
pointer-events none
36-
visibility hidden
3734
.q-layout-drawer-left
3835
left 0
3936
transform translateX(-100%)

src/components/layout/layout.mat.styl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ $layout-transition = all .12s ease-in
3333
z-index $z-fixed-drawer
3434
.q-layout-drawer-delimiter
3535
box-shadow $layout-aside-shadow
36-
.q-layout-drawer-invisible:not(.no-transition)
37-
pointer-events none
38-
visibility hidden
3936
.q-layout-drawer-left
4037
left 0
4138
transform translateX(-100%)

0 commit comments

Comments
 (0)