File tree Expand file tree Collapse file tree 2 files changed +55
-4
lines changed Expand file tree Collapse file tree 2 files changed +55
-4
lines changed Original file line number Diff line number Diff line change 64
64
</template >
65
65
</div >
66
66
67
- <VueLoadingIndicator
68
- v-if =" loading"
69
- class =" overlay"
70
- />
67
+ <transition name =" vue-ui-fade" >
68
+ <VueLoadingIndicator
69
+ v-if =" loading"
70
+ class =" overlay"
71
+ />
72
+ </transition >
71
73
72
74
<VueModal
73
75
v-if =" showCommitModal"
108
110
</template >
109
111
110
112
<script >
113
+ import PageVisibility from ' ../mixins/PageVisibility'
114
+
111
115
import FILE_DIFFS from ' ../graphql/fileDiffs.gql'
112
116
import GIT_COMMIT from ' ../graphql/gitCommit.gql'
113
117
114
118
export default {
119
+ mixins: [
120
+ PageVisibility
121
+ ],
122
+
115
123
data () {
116
124
return {
117
125
fileDiffs: [],
@@ -151,6 +159,14 @@ export default {
151
159
}
152
160
},
153
161
162
+ watch: {
163
+ documentFocus (value ) {
164
+ if (value) {
165
+ this .refresh ()
166
+ }
167
+ }
168
+ },
169
+
154
170
methods: {
155
171
setCollapsedToAll (value ) {
156
172
const map = {}
@@ -180,6 +196,8 @@ export default {
180
196
message: this .commitMessage
181
197
}
182
198
})
199
+ this .showCommitModal = false
200
+ this .refresh ()
183
201
this .$emit (' continue' )
184
202
} catch (e) {
185
203
console .error (e)
Original file line number Diff line number Diff line change
1
+ import Vue from 'vue'
2
+
3
+ const vm = new Vue ( {
4
+ data : {
5
+ documentVisible : ! document . hidden ,
6
+ documentFocus : document . hasFocus ( )
7
+ }
8
+ } )
9
+
10
+ document . addEventListener ( 'visibilitychange' , ( ) => {
11
+ vm . documentVisible = ! document . hidden
12
+ } , false )
13
+
14
+ window . addEventListener ( 'focus' , ( ) => {
15
+ vm . documentFocus = true
16
+ } )
17
+
18
+ window . addEventListener ( 'blur' , ( ) => {
19
+ vm . documentFocus = false
20
+ } )
21
+
22
+ // @vue /component
23
+ export default {
24
+ computed : {
25
+ documentVisible ( ) {
26
+ return vm . documentVisible
27
+ } ,
28
+
29
+ documentFocus ( ) {
30
+ return vm . documentFocus
31
+ }
32
+ }
33
+ }
You can’t perform that action at this time.
0 commit comments