From 387227cc1ff050fcc02afbb23b2ee26e24a5b7a3 Mon Sep 17 00:00:00 2001 From: Samuel Elliott Date: Thu, 9 Aug 2018 22:50:14 +0100 Subject: [PATCH] =?UTF-8?q?Use=20Vue=E2=80=99s=20transition=20element=20to?= =?UTF-8?q?=20transition=20between=20menu=20panels?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../partials/bdsettings/sidebarview.scss | 3 + .../styles/partials/sidebarview/content.scss | 37 ++++---- client/src/ui/bdui.js | 18 ++-- client/src/ui/components/BdSettings.vue | 94 ++++++------------- client/src/ui/components/sidebar/Button.vue | 4 +- client/src/ui/components/sidebar/Item.vue | 4 +- client/src/ui/components/sidebar/index.js | 2 +- 7 files changed, 63 insertions(+), 99 deletions(-) diff --git a/client/src/styles/partials/bdsettings/sidebarview.scss b/client/src/styles/partials/bdsettings/sidebarview.scss index bdb1ae84..50a5e949 100644 --- a/client/src/styles/partials/bdsettings/sidebarview.scss +++ b/client/src/styles/partials/bdsettings/sidebarview.scss @@ -122,6 +122,9 @@ } } + &.bd-stop .bd-sidebar-region { + z-index: 3004; + } &.bd-stop .bd-content-region { z-index: 3003; } diff --git a/client/src/styles/partials/sidebarview/content.scss b/client/src/styles/partials/sidebarview/content.scss index 626230dc..949742fc 100644 --- a/client/src/styles/partials/sidebarview/content.scss +++ b/client/src/styles/partials/sidebarview/content.scss @@ -5,27 +5,28 @@ flex-grow: 1; backface-visibility: hidden; - > div { + > * { display: flex; flex-direction: column; flex-grow: 1; - } - > div:not(.active) { - opacity: 0; - position: absolute; - left: 310px; - right: 0; - // width: 100%; - height: 100%; - pointer-events: none; - } -} - -.bd-content { - animation: bd-fade-in .4s forwards; - - .animating { - animation: bd-fade-out .4s forwards; + &.bd-contentcolumn-enter-active, + &.bd-contentcolumn-leave-active { + transition: opacity 0.4s ease; + } + + &.bd-contentcolumn-enter-to { + opacity: 1; + } + + &.bd-contentcolumn-leave-to { + opacity: 0; + } + + &.bd-contentcolumn-leave-active { + position: absolute; + width: 590px; + pointer-events: none; + } } } diff --git a/client/src/ui/bdui.js b/client/src/ui/bdui.js index 4cf25833..82004844 100644 --- a/client/src/ui/bdui.js +++ b/client/src/ui/bdui.js @@ -46,22 +46,16 @@ export default class { DOM.createElement('div', null, 'bd-toasts').appendTo(DOM.bdToasts); DOM.createElement('bd-tooltips').appendTo(DOM.bdBody); - this.toasts = new Vue({ - el: '#bd-toasts', - components: { BdToasts }, - template: '' + this.toasts = new (Vue.extend(BdToasts))({ + el: '#bd-toasts' }); - this.modals = new Vue({ - el: '#bd-modals', - components: { BdModals }, - template: '' + this.modals = new (Vue.extend(BdModals))({ + el: '#bd-modals' }); - this.vueInstance = new Vue({ - el: '#bd-settings', - components: { BdSettingsWrapper }, - template: '' + this.vueInstance = new (Vue.extend(BdSettingsWrapper))({ + el: '#bd-settings' }); return this.vueInstance; diff --git a/client/src/ui/components/BdSettings.vue b/client/src/ui/components/BdSettings.vue index ab77f5b3..6ef44176 100644 --- a/client/src/ui/components/BdSettings.vue +++ b/client/src/ui/components/BdSettings.vue @@ -9,8 +9,8 @@ */