mirror of
https://github.com/thepaperpilot/Planar-Pioneers.git
synced 2024-11-22 00:21:31 +00:00
Allowed go back button to be disabled in modInfo
This commit is contained in:
parent
c9858ff365
commit
7778fc0a6d
3 changed files with 16 additions and 2 deletions
|
@ -2,7 +2,7 @@
|
|||
<LayerProvider :layer="layer" :index="index">
|
||||
<div class="layer-tab" :style="style" :class="{ hasSubtabs: subtabs }">
|
||||
<branches>
|
||||
<sticky v-if="subtabs" class="subtabs" :class="{ floating, firstTab }">
|
||||
<sticky v-if="subtabs" class="subtabs" :class="{ floating, firstTab: firstTab || !allowGoBack }">
|
||||
<tab-button v-for="(subtab, id) in subtabs" @selectTab="selectSubtab(id)" :key="id" :activeTab="id === activeSubtab"
|
||||
:options="subtab" :text="id" />
|
||||
</sticky>
|
||||
|
@ -18,6 +18,7 @@ import { layers } from '../../store/layers';
|
|||
import { player } from '../../store/proxies';
|
||||
import { coerceComponent } from '../../util/vue';
|
||||
import { isPlainObject } from '../../util/common';
|
||||
import modInfo from '../../data/modInfo.json';
|
||||
import themes from '../../data/themes';
|
||||
|
||||
export default {
|
||||
|
@ -27,6 +28,9 @@ export default {
|
|||
index: Number,
|
||||
forceFirstTab: Boolean
|
||||
},
|
||||
data() {
|
||||
return { allowGoBack: modInfo.allowGoBack };
|
||||
},
|
||||
computed: {
|
||||
floating() {
|
||||
return themes[player.theme].floatingTabs;
|
||||
|
@ -131,6 +135,11 @@ export default {
|
|||
padding-left: 0;
|
||||
}
|
||||
|
||||
.subtabs:not(.floating).firstTab {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
.subtabs:not(.floating):first-child {
|
||||
margin-top: -50px;
|
||||
border-top: 0;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<perfect-scrollbar class="tabs-container">
|
||||
<div class="tabs">
|
||||
<div v-for="(tab, index) in tabs" :key="index" class="tab">
|
||||
<button v-if="index > 0" class="goBack" @click="goBack(index)">←</button>
|
||||
<button v-if="index > 0 && allowGoBack" class="goBack" @click="goBack(index)">←</button>
|
||||
<perfect-scrollbar>
|
||||
<div class="inner-tab">
|
||||
<LayerProvider :layer="tab" :index="index" v-if="tab in components && components[tab]">
|
||||
|
@ -22,9 +22,13 @@
|
|||
import { mapState } from 'vuex';
|
||||
import { layers } from '../../store/layers';
|
||||
import { player } from '../../store/proxies';
|
||||
import modInfo from '../../data/modInfo.json';
|
||||
|
||||
export default {
|
||||
name: 'Tabs',
|
||||
data() {
|
||||
return { allowGoBack: modInfo.allowGoBack };
|
||||
},
|
||||
computed: {
|
||||
...mapState([ 'tabs' ]),
|
||||
components() {
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
"versionNumber": "0.0",
|
||||
"versionTitle": "Initial Commit",
|
||||
|
||||
"allowGoBack": false,
|
||||
"allowSmall": false,
|
||||
"defaultDecimalsShown": 2,
|
||||
"useHeader": true,
|
||||
|
|
Loading…
Reference in a new issue