Fixed: Layout of slot fill dialog is no longer broken by tall images, background is now the correct color

This commit is contained in:
Stefan Zermatten
2021-01-28 16:48:33 +02:00
parent db83d5f82a
commit 2bf749c4f1
2 changed files with 20 additions and 4 deletions

View File

@@ -1,5 +1,8 @@
<template lang="html"> <template lang="html">
<dialog-base :color="model.color"> <dialog-base
:color="model.color"
dark-body
>
<template slot="toolbar"> <template slot="toolbar">
<v-toolbar-title> <v-toolbar-title>
{{ model.name }} {{ model.name }}
@@ -16,9 +19,9 @@
:key="node._id" :key="node._id"
> >
<v-card <v-card
style="max-width: 500px;"
hover hover
ripple ripple
class="slot-card"
:class="{'primary': node._id === (selectedNode && selectedNode._id)}" :class="{'primary': node._id === (selectedNode && selectedNode._id)}"
:dark="node._id === (selectedNode && selectedNode._id)" :dark="node._id === (selectedNode && selectedNode._id)"
@click="selectedNode = node" @click="selectedNode = node"
@@ -26,8 +29,8 @@
<v-img <v-img
v-if="node.picture" v-if="node.picture"
:src="node.picture" :src="node.picture"
:max-height="200" :height="200"
position="top center" contain
/> />
<v-card-title primary-title> <v-card-title primary-title>
<div> <div>
@@ -211,4 +214,9 @@ export default {
</script> </script>
<style lang="css" scoped> <style lang="css" scoped>
.slot-card {
max-width: 500px;
width: 100%;
display: inline-block;
}
</style> </style>

View File

@@ -34,6 +34,7 @@
v-if="!$slots['unwrapped-content']" v-if="!$slots['unwrapped-content']"
id="base-dialog-body" id="base-dialog-body"
v-scroll:#base-dialog-body="onScroll" v-scroll:#base-dialog-body="onScroll"
:class="{'dark-body': darkBody}"
> >
<slot /> <slot />
</v-card-text> </v-card-text>
@@ -56,6 +57,7 @@
type: Function, type: Function,
default: undefined, default: undefined,
}, },
darkBody: Boolean,
}, },
data(){ return { data(){ return {
offsetTop: 0, offsetTop: 0,
@@ -95,4 +97,10 @@
flex-grow: 1; flex-grow: 1;
overflow: auto; overflow: auto;
} }
#base-dialog-body.dark-body {
background-color: #fafafa;
}
.theme--dark #base-dialog-body.dark-body {
background-color: #303030;
}
</style> </style>