Fixed: items and spells should no longer be draggable when you don't have edit permission

This commit is contained in:
Stefan Zermatten
2021-02-12 09:41:24 +02:00
parent b116be1238
commit fed87f0a84
4 changed files with 15 additions and 1 deletions

View File

@@ -7,6 +7,7 @@
<draggable
v-model="dataItems"
style="min-height: 24px;"
:disabled="context.editPermission === false"
:group="`item-list`"
ghost-class="ghost"
draggable=".item"
@@ -37,6 +38,9 @@ export default {
draggable,
ItemListTile,
},
inject: {
context: { default: {} }
},
props: {
items: {
type: Array,

View File

@@ -21,6 +21,7 @@
icon
flat
color="primary"
:disabled="context.editPermission === false"
:value="model.quantity"
@change="changeQuantity"
>
@@ -31,6 +32,7 @@
</v-list-tile-action>
<v-list-tile-action>
<v-icon
:disabled="context.editPermission === false"
style="height: 100%; width: 40px; cursor: move;"
class="handle"
>

View File

@@ -26,6 +26,7 @@
v-else
:key="spell._id"
class="item"
:disabled="context.editPermission === false"
:data-id="`spell-list-tile-${spell._id}`"
:model="spell"
:preparing-spells="preparingSpells"
@@ -47,6 +48,9 @@ export default {
draggable,
SpellListTile,
},
inject: {
context: { default: {} }
},
props: {
spells: {
type: Array,

View File

@@ -22,12 +22,13 @@
<smart-checkbox
v-if="preparingSpells"
:value="model.prepared || model.alwaysPrepared"
:disabled="model.alwaysPrepared"
:disabled="model.alwaysPrepared || context.editPermission === false"
@click.native.stop="() => {}"
@change="setPrepared"
/>
<v-icon
v-else-if="!hideHandle"
:disabled="context.editPermission === false"
style="height: 100%; width: 40px; cursor: move;"
class="handle"
>
@@ -58,6 +59,9 @@ export default {
hideHandle: Boolean,
showInfoButton: Boolean,
},
inject: {
context: { default: {} }
},
computed: {
hasClickListener(){
return this.$listeners && !!this.$listeners.click;