Skip to content

Commit c9d515e

Browse files
committed
added event emitters to pane toggles consistent to css animation and resizing, provides new pane widths
1 parent b973e9c commit c9d515e

3 files changed

Lines changed: 25 additions & 2 deletions

File tree

Template/App.vue

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
</div>
2121

2222
<template #hotspots>
23-
<iv-pane position='left'>
23+
<iv-pane position='left' @paneReveal="paneReveal" @paneHide="paneHide" @paneToggle="paneToggle" @paneResize="paneResize">
2424
<iv-sidebar-content>
2525
<iv-sidebar-section title="SDOF">
2626
This SDOF solver takes in your parameters and then produces a time history plot of your system. Try it out by changing the input parameters and pressing submit to view your solution at the bottom of the page. To submit feedback for this module please click <a href="https://forms.gle/puL3mKPbchXzsRrV7" target="_blank">here</a>.
@@ -83,6 +83,18 @@ export default {
8383
8484
changeInc1(e){
8585
this.min=e;
86+
},
87+
paneReveal(e){
88+
console.log("pane revealed, width: ", e)
89+
},
90+
paneHide(){
91+
console.log("pane hidden")
92+
},
93+
paneToggle(e){
94+
console.log("pane toggled, width", e)
95+
},
96+
paneResize(e){
97+
console.log("new pane width: ", e)
8698
}
8799
}
88100
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@impvis/components",
33

4-
"version": "1.4.0",
4+
"version": "1.4.3",
55

66

77
"license": "BSD-3-Clause",

src/layouts/Pane/Pane.vue

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,24 @@ export default {
123123
const initState = this.showPane
124124
if(initState){
125125
this.$el.classList.add('iv-slide-animation-reverse');
126+
this.$emit("paneHide")
126127
}else{
127128
this.$el.classList.add('iv-slide-animation')
128129
this.showPane = true;
130+
129131
}
132+
initState? this.$emit("paneToggle", 0) : null
130133
setTimeout(()=>{
131134
this.$el.classList.remove((initState)? 'iv-slide-animation-reverse':'iv-slide-animation');
132135
this.showPane = !initState;
136+
if(!initState){
137+
this.$emit("paneToggle", this.widthPx);
138+
this.$emit("paneReveal", this.widthPx);
139+
}
140+
133141
},500);
142+
143+
134144
},
135145
mouseDown(e){
136146
this.resizer.adjusting=true;
@@ -162,6 +172,7 @@ export default {
162172
let deltaX = (pageX - this.resizer.initPageX) * ((this.position_ == "left")? 1:-1)/25;
163173
this.widthPx += (this.widthPx + deltaX > minWidth && this.widthPx + deltaX < this.maxWidth)? deltaX : 0;
164174
this.resizer.initPageX = pageX;
175+
this.$emit("paneResize", this.widthPx)
165176
}
166177
}
167178
}

0 commit comments

Comments
 (0)