File tree Expand file tree Collapse file tree 8 files changed +117
-1
lines changed Expand file tree Collapse file tree 8 files changed +117
-1
lines changed Original file line number Diff line number Diff line change 1515 <iv-toggle-hotspot position =' top' title =' Toggle Hotspot' :glass =true >
1616 I am in a toggle hotspot
1717 <iv-slider ></iv-slider >
18+
19+ <iv-reset-button > Reset </iv-reset-button >
20+
21+ <iv-toggle-basic > </iv-toggle-basic >
22+
23+ <!-- <iv-resetbutton> Reset </iv-resetbutton> -->
24+
1825 </iv-toggle-hotspot >
1926
27+
28+
29+
2030 <iv-fixed-hotspot position =' topright' >
2131 I am in a fixed hotspot
2232 </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+ // import SymbolButton from "SymbolButton.js";
9+ export default {
10+ name: " iv-reset-button" ,
11+ methods: {
12+ mouseOn (e ){
13+ this .$emit (" mouseover" ,e)
14+ },
15+ mouseOff (e ){
16+ this .$emit (" mouseleave" ,e)
17+ },
18+ buttonClick (e ){
19+ let resetChoice= true ;
20+ this .$emit (" click" , e)
21+ eventBus .$emit (" reset-data" , resetChoice)
22+ },
23+ },
24+ props: {
25+ disabled: {
26+ type: Boolean ,
27+ required: false ,
28+ default: false
29+ },
30+
31+ }
32+ }
33+ </script >
34+
35+ <style lang="scss">
36+ @import " src/globals" ;
37+ $green :#19CF86 ;
38+ $greenHover :#1BDE90 ;
39+ $greenClick :#139C65 ;
40+ $disabledColor :#D3D3D3 ;
41+ .iv-reset-button {
42+ border : none ;
43+ text-align : center ;
44+ text-decoration : none ;
45+ display : inline-block ;
46+ font-size : 1.2rem ;
47+ height :1.45rem ;
48+ padding : 0.25em 0.5em ;
49+ background-color : $green ;
50+ color :$white ;
51+ font-weight :500 ;
52+ transition : all 0.2s ;
53+ & :focus {
54+ outline :0 ;
55+ }
56+
57+ & :hover {
58+ background-color :$greenHover ;
59+ }
60+ & :active {
61+ background :$greenClick ;
62+ color :#F0FFF0 ;
63+ }
64+
65+
66+ & :disabled {
67+ background-color :$disabledColor ;
68+ color :#a3a3a3 ;
69+ }
70+ }
71+
72+
73+ </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,21 @@ 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 (" slider!" )
165+ console .log (data);
166+
167+ this .value = this .init_val ;
168+ })
159169 },
160170 watch: {
161171 current_step : function (){
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,20 @@ 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+ console .log (" made it!" )
59+ this .toggleValue = 0 ;
60+ console .log (this .toggleValue )
61+ });
62+
63+
64+
65+
66+
5267 }
5368};
5469 </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