File tree Expand file tree Collapse file tree 2 files changed +41
-3
lines changed Expand file tree Collapse file tree 2 files changed +41
-3
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ let redoMixin = {
93
93
if (undone !== undefined ) {
94
94
this .undoneAction .push (undone)
95
95
if (undone .type === ' setActiveComponent' ) {
96
- console .log (' We did something useless!' )
96
+ // console.log('We did something useless!')
97
97
do {
98
98
this .undoneAction .push (this .doneAction .pop ())
99
99
}
@@ -110,9 +110,8 @@ let redoMixin = {
110
110
store: this .$store
111
111
}
112
112
this .$store .commit (' EMPTY_STATE' , payload)
113
- console .log (this .$store )
114
113
this .doneAction .forEach (action => {
115
- console .log (' In the loop' , this .$store )
114
+ // console.log('In the loop', this.$store)
116
115
// this.$store.commit(`${mutation.type}`, mutation.payload);
117
116
this .$store .dispatch (action .type , cloneDeep (action .payload ))
118
117
this .doneAction .pop ()
Original file line number Diff line number Diff line change 9
9
<!-- <q-avatar></q-avatar> -->
10
10
OverVue
11
11
</q-toolbar-title >
12
+ <div >
13
+ <!-- <i class="fa fa-undo" aria-hidden="true"></i> -->
14
+ <!-- <i class="fas fa fa-repeat" aria-hidden="true"></i> -->
15
+ <i v-if =' this.$router.app.$children[0].doneAction.length' class =" fa fa-backward" aria-hidden =" true" @click =" undo" ></i >
16
+ <i v-else class =" fa fa-backward" id =" unavailable" aria-hidden =" true" ></i >
17
+ <i v-if =' this.$router.app.$children[0].undoneAction.length' class =" fa fa-forward" aria-hidden =" true" @click =" redo" ></i >
18
+ <i v-else class =" fa fa-forward" id =" unavailable" aria-hidden =" true" ></i >
12
19
<OpenProjectComponent />
13
20
<SaveProjectComponent />
14
21
<ExportProjectComponent />
22
+ </div >
15
23
</q-toolbar >
16
24
</q-header >
17
25
@@ -55,11 +63,42 @@ export default {
55
63
SaveProjectComponent,
56
64
OpenProjectComponent,
57
65
UploadImage
66
+ },
67
+ methods: {
68
+ undo () {
69
+ console .log (' UNDO FROM BUTTON' )
70
+ console .log (' look at me ' , this .$router .app .$children [0 ].doneAction )
71
+ this .$router .app .$children [0 ].undo ()
72
+ },
73
+ redo () {
74
+ console .log (' REDO FROM BUTTON' )
75
+ this .$router .app .$children [0 ].redo ()
76
+ }
58
77
}
59
78
}
60
79
</script >
61
80
62
81
<style lang="stylus">
82
+
83
+ .fa-backward , .fa-forward {
84
+ padding : 0 5px
85
+ }
86
+
87
+ .fa-backward :hover , .fa-forward :hover {
88
+ cursor : pointer ;
89
+ color : #00 ff ff
90
+ }
91
+
92
+ #unavailable {
93
+ color : grey ;
94
+ cursor : default
95
+ }
96
+
97
+ .fa-backward :active , .fa-forward :active {
98
+ box-shadow : 0 1px inherit ;
99
+ transform : translateY (1px );
100
+ }
101
+
63
102
.q-layout {
64
103
transition-timing-function : ease-in ;
65
104
}
You can’t perform that action at this time.
0 commit comments