Skip to content

Commit 01069d3

Browse files
committed
feat: QSlideTransition/QTree/QCollapsible new prop: "duration" (Number)
1 parent 75dd985 commit 01069d3

File tree

5 files changed

+16
-9
lines changed

5 files changed

+16
-9
lines changed

src/components/collapsible/QCollapsible.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export default {
2727
iconToggle: Boolean,
2828
collapseIcon: String,
2929
opened: Boolean,
30+
duration: Number,
3031

3132
headerStyle: [Array, String, Object],
3233
headerClass: [Array, String, Object]
@@ -124,7 +125,9 @@ export default {
124125
])
125126
: h(QItemWrapper, this.__getItemProps(true), this.__getToggleSide(h, true)),
126127

127-
h(QSlideTransition, [
128+
h(QSlideTransition, {
129+
props: { duration: this.duration }
130+
}, [
128131
h('div', {
129132
directives: [{ name: 'show', value: this.showing }]
130133
}, [

src/components/slide-transition/QSlideTransition.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
export default {
22
name: 'QSlideTransition',
33
props: {
4-
appear: Boolean
4+
appear: Boolean,
5+
duration: {
6+
type: Number,
7+
default: 300
8+
}
59
},
610
methods: {
711
__begin (el, height) {
812
el.style.overflowY = 'hidden'
913
if (height !== void 0) {
1014
el.style.height = `${height}px`
1115
}
12-
el.classList.add('q-slide-transition')
16+
el.style.transition = `height ${this.duration}ms cubic-bezier(.25, .8, .50, 1)`
1317
this.animating = true
1418
},
1519
__end (el, event) {
1620
el.style.overflowY = null
1721
el.style.height = null
18-
el.classList.remove('q-slide-transition')
22+
el.style.transition = null
1923
this.__cleanup()
2024
event !== this.lastEvent && this.$emit(event)
2125
this.animating = false

src/components/slide-transition/slide-transition.ios.styl

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/components/slide-transition/slide-transition.mat.styl

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/components/tree/QTree.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ export default {
5252
}
5353
},
5454

55+
duration: Number,
56+
5557
noNodesLabel: String,
5658
noResultsLabel: String
5759
},
@@ -492,7 +494,9 @@ export default {
492494
]),
493495

494496
isParent
495-
? h(QSlideTransition, [
497+
? h(QSlideTransition, {
498+
props: { duration: this.duration }
499+
}, [
496500
h('div', {
497501
directives: [{ name: 'show', value: meta.expanded }],
498502
staticClass: 'q-tree-node-collapsible',

0 commit comments

Comments
 (0)