File tree Expand file tree Collapse file tree 10 files changed +120
-4
lines changed Expand file tree Collapse file tree 10 files changed +120
-4
lines changed Original file line number Diff line number Diff line change 55 <!-- <img src='./assets/ImpVis-logo.png' alt="ImpVisLogo" height="50"/> -->
66 <h1 > Welcome to Imperial Visualisations!</h1 >
77 <p > Your project, {{projectName}} has succesfully been set up using the NodeJS template!</p >
8- <iv-hover-text ></iv-hover-text >
98 </div >
109
1110
1514 <iv-toggle-hotspot position =' top' title =' Toggle Hotspot' :glass =true >
1615 I am in a toggle hotspot
1716 <iv-slider ></iv-slider >
17+
18+ <iv-reset-button > Reset </iv-reset-button >
19+
20+ <iv-toggle-basic > </iv-toggle-basic >
21+ <iv-toggle-advance ></iv-toggle-advance >
22+ <iv-tickbox ></iv-tickbox >
23+
1824 </iv-toggle-hotspot >
1925
26+
2027 <iv-fixed-hotspot position =' topright' >
2128 I am in a fixed hotspot
2229 </iv-fixed-hotspot >
Original file line number Diff line number Diff line change 1+ import Vue from "vue" ;
2+ export const eventBus = new Vue ( ) ;
3+
Original file line number Diff line number Diff line change 1+ <template >
2+ <button class =" iv-reset-button iv-drop-shadow-medium" style =" height :100% " @mouseover =" mouseOn" @mouseleave =" mouseOff" @click =" buttonClick(e)" :disabled =" disabled" >
3+ <slot >Default text</slot ></button >
4+ </template >
5+
6+ <script >
7+ import { eventBus } from " @/buses/eventBus" ;
8+ export default {
9+ name: " iv-reset-button" ,
10+ methods: {
11+ mouseOn (e ){
12+ this .$emit (" mouseover" ,e)
13+ },
14+ mouseOff (e ){
15+ this .$emit (" mouseleave" ,e)
16+ },
17+ buttonClick (e ){
18+ this .$emit (" click" , e)
19+ eventBus .$emit (" reset-data" , this .resetChoice )
20+ },
21+ },
22+ props: {
23+ disabled: {
24+ type: Boolean ,
25+ required: false ,
26+ default: false
27+ },
28+ resetChoice: {
29+ type: Boolean ,
30+ required: false ,
31+ default: true ,
32+ }
33+
34+ }
35+ }
36+ </script >
37+
38+ <style lang="scss">
39+ @import " src/globals" ;
40+ $green :#19CF86 ;
41+ $greenHover :#1BDE90 ;
42+ $greenClick :#139C65 ;
43+ $disabledColor :#D3D3D3 ;
44+ .iv-reset-button {
45+ border : none ;
46+ text-align : center ;
47+ text-decoration : none ;
48+ display : inline-block ;
49+ font-size : 1.2rem ;
50+ height :1.45rem ;
51+ padding : 0.25em 0.5em ;
52+ background-color : $green ;
53+ color :$white ;
54+ font-weight :500 ;
55+ transition : all 0.2s ;
56+ & :focus {
57+ outline :0 ;
58+ }
59+
60+ & :hover {
61+ background-color :$greenHover ;
62+ }
63+ & :active {
64+ background :$greenClick ;
65+ color :#F0FFF0 ;
66+ }
67+
68+
69+ & :disabled {
70+ background-color :$disabledColor ;
71+ color :#a3a3a3 ;
72+ }
73+ }
74+
75+
76+ </style >
Original file line number Diff line number Diff line change 1+ import ResetButton from "./ResetButton.vue" ;
2+ //import SymbolButton from "./SymbolButton.vue";
3+ export default ResetButton ;
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import BubbleComp from './bubble.vue';
1919import InputButton from ' ./inputButton.vue' ;
2020import Theme from ' @/Theme.js' ;
2121import Button from ' ../Button/Button.vue' ;
22+ import {eventBus } from " @/buses/eventBus" ;
2223export default {
2324 name: " iv-slider" ,
2425 components: {
@@ -150,12 +151,20 @@ export default {
150151 }
151152 }
152153 },
154+
153155 mounted () {
154156 this .id = this ._uid ;
155157 // this.min_step_size();
156158 this .tick_list = this .calc_ticks ();
157159 this .tick_line_key = " tick_line_" + this ._uid ;
158160 this .tick_num_key = " tick_num_" + this ._uid ;
161+
162+
163+ eventBus .$on (" reset-data" , data => {
164+ console .log (data);
165+
166+ this .value = this .init_val ;
167+ })
159168 },
160169 watch: {
161170 current_step : function (){
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ export default {
3434 this .$emit (" unchecked" , this .checkboxStatus )
3535 }
3636 }
37- }
37+ },
3838}
3939 </script >
4040<style >
Original file line number Diff line number Diff line change 55</template >
66
77<script >
8- import ToggleAdvanceButton from " ./ToggleAdvanceButton.vue"
8+ import ToggleAdvanceButton from " ./ToggleAdvanceButton.vue" ;
9+ import {eventBus } from " @/buses/eventBus" ;
10+
911export default {
1012 name: " iv-toggle-advance" ,
1113 components: {" iv-toggle-advance-button" : ToggleAdvanceButton},
@@ -42,6 +44,12 @@ export default {
4244 return false ;
4345 }
4446 }
47+ },
48+ mounted (){
49+ eventBus .$on (" reset-data" , data => {
50+ console .log (data);
51+ this .toggleModeIndex = this .initialModeIndex ;
52+ });
4553 }
4654}
4755 </script >
Original file line number Diff line number Diff line change 2020 </div >
2121</template >
2222<script >
23+ import {eventBus } from " @/buses/eventBus" ;
2324export default {
2425 name: " iv-toggle-basic" ,
2526 props: {
@@ -49,6 +50,13 @@ export default {
4950 this .toggleValue = ! this .toggleValue
5051 this .$emit (' input' , ! this .toggleValue );
5152 }
53+ },
54+
55+ mounted (){
56+ eventBus .$on (" reset-data" , data => {
57+ console .log (data);
58+ this .toggleValue = 0 ;
59+ });
5260 }
5361};
5462 </script >
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ export {default as DropdownList} from "./DropdownList";
99export { default as ToggleBasic } from "./ToggleBasic" ;
1010export { default as ToggleAdvance } from "./ToggleAdvance" ;
1111export { default as Tickbox } from "./Tickbox" ;
12+
1213export { default as SectionTitle } from "./Titles" ;
1314//export {default as Play_Button} from "./Play_Button";
1415export { SymbolButton , Button } from "./Button" ;
@@ -21,5 +22,6 @@ export {default as LegacyWrapper} from './LegacyWrapper';
2122export { SectionHeading , SidebarSection , SidebarContent } from './SidebarText' ;
2223export { PageIndicator , PaneNavigator } from './Navigation' ;
2324export { default as Meter } from './Meter' ;
25+ export { default as ResetButton } from "./ResetButton" ;
2426// For folders containg multiple exported components write:
2527// export {ComponentA,ComponentB} from './ComponentFolder';
You can’t perform that action at this time.
0 commit comments