Skip to content

Commit

Permalink
Merge pull request #253 from akhuoa/bugfix/fullscreen
Browse files Browse the repository at this point in the history
Fix ESC fullscreen toggle
  • Loading branch information
alan-wu authored Nov 4, 2024
2 parents 12d1d1b + 44d9abc commit 7da8cf3
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/components/DialogToolbarContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<map-svg-icon icon="help" class="sync-help header-icon"/>
</template>
<template #default>
When in Linked mode the two maps will interact
When in Linked mode the two maps will interact
<br>
together. Select an organ in one and it will
<br>
Expand Down Expand Up @@ -279,6 +279,11 @@ export default {
this.$emit("onFullscreen");
this.isFullscreen = !this.isFullscreen;
},
onFullscreenEsc: function () {
if (!document.fullscreenElement) {
this.isFullscreen = false;
}
},
close: function() {
this.$emit("close");
},
Expand Down Expand Up @@ -306,6 +311,11 @@ export default {
mounted: function () {
this.activeViewRef = shallowRef(this.$refs.activeViewRef);
this.permalinkRef = shallowRef(this.$refs.permalinkRef);
document.addEventListener('fullscreenchange', this.onFullscreenEsc);
},
unmounted: function () {
document.removeEventListener('fullscreenchange', this.onFullscreenEsc);
},
};
</script>
Expand Down Expand Up @@ -372,7 +382,7 @@ export default {
&:hover, &:focus {
color:#FFFFFF;
background-color:$app-primary-color;
box-shadow: -3px 2px 4px #000000;
box-shadow: -3px 2px 4px #000000;
}
}

Expand Down

0 comments on commit 7da8cf3

Please sign in to comment.