Merge branch 'beforeunload-fix' into 'master'
Beforeunload fix (fixes issue 24) See merge request openflexure/openflexure-microscope-jsclient!12
This commit is contained in:
commit
f87e6d55e9
2 changed files with 8 additions and 1 deletions
|
|
@ -1,7 +1,6 @@
|
||||||
extends: app/builder-config-base.yaml
|
extends: app/builder-config-base.yaml
|
||||||
linux:
|
linux:
|
||||||
target:
|
target:
|
||||||
- AppImage
|
|
||||||
- target: deb
|
- target: deb
|
||||||
arch:
|
arch:
|
||||||
- armv7l
|
- armv7l
|
||||||
|
|
@ -9,4 +8,5 @@ linux:
|
||||||
category: Science
|
category: Science
|
||||||
deb:
|
deb:
|
||||||
category: Science
|
category: Science
|
||||||
|
fpm: ['--architecture', 'armhf']
|
||||||
electronVersion: 3.0.13
|
electronVersion: 3.0.13
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,8 @@ export default {
|
||||||
|
|
||||||
window.addEventListener('resize', this.handleResize)
|
window.addEventListener('resize', this.handleResize)
|
||||||
this.handleResize();
|
this.handleResize();
|
||||||
|
|
||||||
|
window.addEventListener('beforeunload', this.handleExit)
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeDestroy: function () {
|
beforeDestroy: function () {
|
||||||
|
|
@ -73,6 +75,11 @@ export default {
|
||||||
handleResize: function(event) {
|
handleResize: function(event) {
|
||||||
this.window.width = window.innerWidth;
|
this.window.width = window.innerWidth;
|
||||||
this.window.height = window.innerHeight;
|
this.window.height = window.innerHeight;
|
||||||
|
},
|
||||||
|
|
||||||
|
handleExit: function(event) {
|
||||||
|
console.log("Triggered beforeunload")
|
||||||
|
this.$root.$emit('globalTogglePreview', false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue