Overhauled library UI to work on small screens
This commit is contained in:
@@ -1,64 +1,72 @@
|
||||
<template>
|
||||
<v-layout column style="height: 100%;">
|
||||
<v-toolbar :color="color || 'secondary'" dark class="base-dialog-toolbar" :flat="!offsetTop">
|
||||
<v-btn icon flat @click="back">
|
||||
<v-icon>arrow_back</v-icon>
|
||||
</v-btn>
|
||||
<slot name="toolbar"/>
|
||||
<template v-if="$slots.edit">
|
||||
<v-spacer/>
|
||||
<v-btn icon flat @click="$emit('remove')" v-if="isEditing">
|
||||
<v-icon>delete</v-icon>
|
||||
</v-btn>
|
||||
<v-btn icon flat @click="isEditing = !isEditing">
|
||||
<v-icon>{{isEditing ? 'check' : 'create'}}</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
</v-toolbar>
|
||||
<template v-if="breadcrumbs">
|
||||
<v-card-text>
|
||||
example > bread > crumb
|
||||
</v-card-text>
|
||||
</template>
|
||||
<div
|
||||
v-if="$slots['unwrapped-content']"
|
||||
class="unwrapped-content"
|
||||
>
|
||||
<slot name="unwrapped-content"/>
|
||||
</div>
|
||||
<v-card-text
|
||||
v-if="!$slots['unwrapped-content']"
|
||||
id="base-dialog-body"
|
||||
v-scroll:#base-dialog-body="onScroll"
|
||||
>
|
||||
<v-tabs-items :value="isEditing ? 1 : 0" touchless>
|
||||
<v-tab-item>
|
||||
<slot/>
|
||||
</v-tab-item>
|
||||
<v-tab-item lazy>
|
||||
<slot name="edit"/>
|
||||
</v-tab-item>
|
||||
</v-tabs-items>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<slot name="actions"/>
|
||||
</v-card-actions>
|
||||
</v-layout>
|
||||
<v-layout
|
||||
column
|
||||
style="height: 100%;"
|
||||
>
|
||||
<slot
|
||||
name="replace-toolbar"
|
||||
:flat="!offsetTop"
|
||||
>
|
||||
<v-toolbar
|
||||
:color="computedColor"
|
||||
:dark="isDark"
|
||||
class="base-dialog-toolbar"
|
||||
:flat="!offsetTop"
|
||||
>
|
||||
<v-btn
|
||||
icon
|
||||
flat
|
||||
@click="back"
|
||||
>
|
||||
<v-icon>arrow_back</v-icon>
|
||||
</v-btn>
|
||||
<slot name="toolbar" />
|
||||
</v-toolbar>
|
||||
</slot>
|
||||
<div
|
||||
v-if="$slots['unwrapped-content']"
|
||||
class="unwrapped-content"
|
||||
>
|
||||
<slot name="unwrapped-content" />
|
||||
</div>
|
||||
<v-card-text
|
||||
v-if="!$slots['unwrapped-content']"
|
||||
id="base-dialog-body"
|
||||
v-scroll:#base-dialog-body="onScroll"
|
||||
>
|
||||
<slot />
|
||||
</v-card-text>
|
||||
<v-card-actions v-if="$slots.actions">
|
||||
<slot name="actions" />
|
||||
</v-card-actions>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import store from "/imports/ui/vuexStore.js";
|
||||
import isDarkColor from '/imports/ui/utility/isDarkColor.js';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
color: String,
|
||||
breadcrumbs: Object,
|
||||
overrideBackButton: Function,
|
||||
color: {
|
||||
type: String,
|
||||
default: undefined,
|
||||
},
|
||||
overrideBackButton: {
|
||||
type: Function,
|
||||
default: undefined,
|
||||
},
|
||||
},
|
||||
data(){ return {
|
||||
offsetTop: 0,
|
||||
isEditing: false,
|
||||
}},
|
||||
computed: {
|
||||
isDark(){
|
||||
return isDarkColor(this.computedColor);
|
||||
},
|
||||
computedColor(){
|
||||
return this.color || this.$vuetify.theme.secondary;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onScroll(e){
|
||||
this.offsetTop = e.target.scrollTop
|
||||
@@ -71,7 +79,7 @@
|
||||
}
|
||||
},
|
||||
close(){
|
||||
store.dispatch("popDialogStack");
|
||||
this.$store.dispatch('popDialogStack');
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user