File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6464 </template >
6565 </div >
6666
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 >
7173
7274 <VueModal
7375 v-if =" showCommitModal"
108110</template >
109111
110112<script >
113+ import PageVisibility from ' ../mixins/PageVisibility'
114+
111115import FILE_DIFFS from ' ../graphql/fileDiffs.gql'
112116import GIT_COMMIT from ' ../graphql/gitCommit.gql'
113117
114118export default {
119+ mixins: [
120+ PageVisibility
121+ ],
122+
115123 data () {
116124 return {
117125 fileDiffs: [],
@@ -151,6 +159,14 @@ export default {
151159 }
152160 },
153161
162+ watch: {
163+ documentFocus (value ) {
164+ if (value) {
165+ this .refresh ()
166+ }
167+ }
168+ },
169+
154170 methods: {
155171 setCollapsedToAll (value ) {
156172 const map = {}
@@ -180,6 +196,8 @@ export default {
180196 message: this .commitMessage
181197 }
182198 })
199+ this .showCommitModal = false
200+ this .refresh ()
183201 this .$emit (' continue' )
184202 } catch (e) {
185203 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