From 79f094066e0f3ea91afcf38dc3acc3cf467c5db1 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Thu, 7 Feb 2019 16:47:09 +0000 Subject: [PATCH] Added sidebar toggle --- src/App.vue | 71 ++++++++++++++++++- .../paneConnectComponents/hostInput.vue | 1 - src/components/panelLeft.vue | 10 +-- 3 files changed, 75 insertions(+), 7 deletions(-) diff --git a/src/App.vue b/src/App.vue index 53ed662e..85d43cc0 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,6 +1,19 @@ @@ -19,9 +32,51 @@ import panelLeft from './components/panelLeft.vue' // Export main app export default { name: 'app', + components: { panelLeft + }, + + data: function () { + return { + window: { + width: 0, + height: 0 + } + } + }, + + created: function () { + window.addEventListener('resize', this.handleResize) + this.handleResize(); + }, + + beforeDestroy: function () { + window.removeEventListener('resize', this.handleResize) + }, + + methods: { + handleResize: function(event) { + this.window.width = window.innerWidth; + this.window.height = window.innerHeight; + } + }, + + computed: { + // Stylises the hostname input box based on connection status + responsivePanelLeft: function () { + return { + //'uk-hidden': this.window.width<850, + 'overlay-panel': this.window.width<850 + } + }, + responsiveToggleButton: function () { + return { + //'uk-hidden': this.window.width>=850, + } + } } + } @@ -42,4 +97,18 @@ body, html { height: 100% } +.overlay-panel { + position: fixed; + z-index: 99; +} + +#overlay-toggle { + width: 30px; + height: 30px; + position: fixed; + right: 0; + margin: 20px; + z-index: 999 +} + diff --git a/src/components/paneConnectComponents/hostInput.vue b/src/components/paneConnectComponents/hostInput.vue index cd3011cb..e3cb633b 100644 --- a/src/components/paneConnectComponents/hostInput.vue +++ b/src/components/paneConnectComponents/hostInput.vue @@ -65,6 +65,5 @@ export default { diff --git a/src/components/panelLeft.vue b/src/components/panelLeft.vue index 26bad493..0fbe2382 100644 --- a/src/components/panelLeft.vue +++ b/src/components/panelLeft.vue @@ -1,5 +1,5 @@