Skip to content

Commit

Permalink
Hide side menu on small screens
Browse files Browse the repository at this point in the history
  • Loading branch information
ingalls committed Aug 8, 2024
1 parent b17da1c commit 903c32a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
21 changes: 17 additions & 4 deletions api/web/src/components/CloudTAK/Map.vue
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,14 @@
</div>

<SideMenu
v-if='isLoaded && !pointInput'
:mobile='mobileDetected'
v-if='
isLoaded
&& !pointInput
&& (
(noMenuShown && !mobileDetected)
|| (!noMenuShown)
)
'
:compact='noMenuShown'
/>

Expand Down Expand Up @@ -566,8 +572,8 @@ export default {
//TODO: This needs to follow something like:
// https://stackoverflow.com/questions/47219272/how-can-i-monitor-changing-window-sizes-in-vue
return (
( window.innerWidth <= 800 )
&& ( window.innerHeight <= 800 )
( this.width <= 800 )
|| ( this.height <= 800 )
);
},
humanBearing: function() {
Expand Down Expand Up @@ -608,6 +614,11 @@ export default {
this.$emit('err', new Error(evt.message));
});
window.addEventListener('resize', (evt) => {
this.height = window.innerHeight;
this.width = window.innerWidth;
});
await this.mountMap();
await Promise.all([
Expand Down Expand Up @@ -646,6 +657,8 @@ export default {
data: function() {
return {
mode: 'Default',
height: window.innerHeight,
width: window.innerWidth,
warnChannels: false, // Show a popup if no channels are selected on load
search: {
shown: false,
Expand Down
1 change: 0 additions & 1 deletion api/web/src/components/CloudTAK/Menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,6 @@ export default {
},
props: {
compact: Boolean,
mobileDetected: Boolean
},
methods: {
push: function(path) {
Expand Down

0 comments on commit 903c32a

Please sign in to comment.