Fix extra space on macOS in the plugins and themes panel and use BdMenuItems to add the super secret view

This commit is contained in:
Samuel Elliott 2019-03-09 21:43:41 +00:00
parent dc85a808f8
commit ead0fbbd1e
No known key found for this signature in database
GPG Key ID: 8420C7CDE43DC4D6
2 changed files with 11 additions and 19 deletions

View File

@ -22,12 +22,12 @@
> .bd-scroller { > .bd-scroller {
overflow-y: scroll; overflow-y: scroll;
}
}
.bd-settings & { .bd-settings & {
.platform-darwin & { // sass-lint:disable-line class-name-format .platform-darwin & { // sass-lint:disable-line class-name-format
padding-top: 22px; padding-top: 22px;
}
}
} }
} }

View File

@ -20,7 +20,6 @@
<SidebarItem :item="{text, type: 'header'}" /> <SidebarItem :item="{text, type: 'header'}" />
<SidebarItem v-for="i in category" :key="i.id" :item="i" :active="item && i.id === item.id" @click="itemOnClick(i.id)" /> <SidebarItem v-for="i in category" :key="i.id" :item="i" :active="item && i.id === item.id" @click="itemOnClick(i.id)" />
</template> </template>
<SidebarItem v-if="superSecretMenu" :item="{ _type: 'button', text: 'Super Secret' }" :active="superSecretMenuActive" @click="itemOnClick('superSecretMenu')"/>
</Sidebar> </Sidebar>
<div slot="sidebarfooter" class="bd-info"> <div slot="sidebarfooter" class="bd-info">
@ -38,8 +37,7 @@
<ContentColumn slot="content"> <ContentColumn slot="content">
<transition name="bd-contentcolumn" @before-enter="animating++" @after-enter="animating--" @enter-cancelled="animating--" @before-leave="animating++" @after-leave="animating--" @leave-cancelled="animating--"> <transition name="bd-contentcolumn" @before-enter="animating++" @after-enter="animating--" @enter-cancelled="animating--" @before-leave="animating++" @after-leave="animating--" @leave-cancelled="animating--">
<SuperSecretView v-if="superSecretMenuActive"/> <div v-if="item" :key="item.id">
<div v-else-if="item" :key="item.id">
<template v-if="item.component"> <template v-if="item.component">
<component :is="item.component" :SettingsWrapper="SettingsWrapper" /> <component :is="item.component" :SettingsWrapper="SettingsWrapper" />
</template> </template>
@ -80,15 +78,13 @@
items: BdMenuItems.items, items: BdMenuItems.items,
Settings, Settings,
SettingsWrapper, SettingsWrapper,
openMenuHandler: null, openMenuHandler: null
superSecretMenu: false,
superSecretMenuActive: false
}; };
}, },
props: ['active'], props: ['active'],
components: { components: {
SidebarView, Sidebar, SidebarItem, ContentColumn, SidebarView, Sidebar, SidebarItem, ContentColumn,
SettingsWrapper, SettingsPanel, CssEditorView, PluginsView, ThemesView, UpdaterView, ConnectivityView, SuperSecretView, SettingsWrapper, SettingsPanel, CssEditorView, PluginsView, ThemesView, UpdaterView, ConnectivityView,
MiGithubCircle, MiWeb, MiClose, MiTwitterCircle MiGithubCircle, MiWeb, MiClose, MiTwitterCircle
}, },
computed: { computed: {
@ -107,12 +103,6 @@
}, },
methods: { methods: {
itemOnClick(id) { itemOnClick(id) {
if (id === 'superSecretMenu') {
this.item = 'supersecretmenu';
this.superSecretMenuActive = true;
return;
}
this.superSecretMenuActive = false;
this.item = this.items.find(item => item.id === id); this.item = this.items.find(item => item.id === id);
}, },
closeContent() { closeContent() {
@ -138,7 +128,9 @@
Events.on('bd-open-menu', this.openMenuHandler = item => item && this.itemOnClick(this.items.find(i => i === item || i.id === item || i.contentid === item || i.set === item).id)); Events.on('bd-open-menu', this.openMenuHandler = item => item && this.itemOnClick(this.items.find(i => i === item || i.id === item || i.contentid === item || i.set === item).id));
try { try {
const currentUser = Reflection.module.byName('UserStore').getCurrentUser(); const currentUser = Reflection.module.byName('UserStore').getCurrentUser();
this.superSecretMenu = ['81388395867156480', '98003542823944192', '249746236008169473', '284056145272766465', '478559353516064769'].includes(currentUser.id) if (['81388395867156480', '98003542823944192', '249746236008169473', '284056145272766465', '478559353516064769'].includes(currentUser.id) || true) {
BdMenuItems.addVueComponent('BD Devs', 'Super Secret', SuperSecretView);
}
} catch (err) {} } catch (err) {}
}, },
destroyed() { destroyed() {