2018-06-05 13:54:03 +00:00
|
|
|
<template>
|
2018-06-07 22:43:12 +00:00
|
|
|
<x-column :menu="menu" :name="name" :column="column" :is-stacked="isStacked">
|
2018-06-07 19:21:06 +00:00
|
|
|
<span slot="header">
|
|
|
|
<template v-if="column.type == 'home'">%fa:home%</template>
|
|
|
|
<template v-if="column.type == 'local'">%fa:R comments%</template>
|
|
|
|
<template v-if="column.type == 'global'">%fa:globe%</template>
|
|
|
|
<template v-if="column.type == 'list'">%fa:list%</template>
|
|
|
|
<span>{{ name }}</span>
|
|
|
|
</span>
|
2018-06-05 20:18:08 +00:00
|
|
|
|
2018-06-09 16:01:28 +00:00
|
|
|
<div class="editor" style="padding:0 12px" v-if="edit">
|
2018-06-07 19:21:06 +00:00
|
|
|
<mk-switch v-model="column.isMediaOnly" @change="onChangeSettings" text="%i18n:@is-media-only%"/>
|
|
|
|
<mk-switch v-model="column.isMediaView" @change="onChangeSettings" text="%i18n:@is-media-view%"/>
|
|
|
|
</div>
|
2018-06-09 16:01:28 +00:00
|
|
|
<x-list-tl v-if="column.type == 'list'" :list="column.list" :media-only="column.isMediaOnly" :media-view="column.isMediaView"/>
|
|
|
|
<x-tl v-else :src="column.type" :media-only="column.isMediaOnly" :media-view="column.isMediaView"/>
|
2018-06-07 19:21:06 +00:00
|
|
|
</x-column>
|
2018-06-05 13:54:03 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
|
|
|
import XColumn from './deck.column.vue';
|
|
|
|
import XTl from './deck.tl.vue';
|
2018-06-05 20:18:08 +00:00
|
|
|
import XListTl from './deck.list-tl.vue';
|
2018-06-05 13:54:03 +00:00
|
|
|
|
|
|
|
export default Vue.extend({
|
|
|
|
components: {
|
|
|
|
XColumn,
|
2018-06-05 20:18:08 +00:00
|
|
|
XTl,
|
|
|
|
XListTl
|
2018-06-05 13:54:03 +00:00
|
|
|
},
|
|
|
|
|
2018-06-07 20:48:27 +00:00
|
|
|
props: {
|
|
|
|
column: {
|
|
|
|
type: Object,
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
isStacked: {
|
|
|
|
type: Boolean,
|
|
|
|
required: true
|
|
|
|
}
|
|
|
|
},
|
2018-06-06 21:13:57 +00:00
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
edit: false,
|
|
|
|
menu: [{
|
2018-06-08 02:46:45 +00:00
|
|
|
icon: '%fa:cog%',
|
|
|
|
text: '%i18n:@edit%',
|
|
|
|
action: () => {
|
2018-06-06 21:13:57 +00:00
|
|
|
this.edit = !this.edit;
|
|
|
|
}
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
computed: {
|
|
|
|
name(): string {
|
|
|
|
if (this.column.name) return this.column.name;
|
|
|
|
|
|
|
|
switch (this.column.type) {
|
|
|
|
case 'home': return '%i18n:common.deck.home%';
|
|
|
|
case 'local': return '%i18n:common.deck.local%';
|
|
|
|
case 'global': return '%i18n:common.deck.global%';
|
|
|
|
case 'list': return this.column.list.title;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
onChangeSettings(v) {
|
|
|
|
this.$store.dispatch('settings/saveDeck');
|
|
|
|
}
|
2018-06-05 20:18:08 +00:00
|
|
|
}
|
2018-06-05 13:54:03 +00:00
|
|
|
});
|
|
|
|
</script>
|