Compare commits

...

2 Commits

Author SHA1 Message Date
aminecmi
20069bfe84 Updating the items content.
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing
2022-08-06 13:58:02 +02:00
aminecmi
8c4f036431 Handle for mobile use. 2022-08-06 13:57:38 +02:00
2 changed files with 9 additions and 5 deletions

View File

@ -1,14 +1,14 @@
<template>
<div class="panel-block" v-bind:class="{'disabled': element.loading}">
<span class="icon is-pulled-left" v-if="canMove">
<span class="icon is-pulled-left handle" v-if="canMove">
<ion-icon name="move-outline"></ion-icon>
</span>
<input type="checkbox" v-model="element.checked" v-on:change="updateItem(element)">
<input type="checkbox" v-model="element.checked" v-on:change="updateCheckbox(element)">
<div class="field is-horizontal has-addons">
<div class="control">
<input class="input" type="text" v-bind:disabled="element.checked" v-model="element.content"
v-on:blur="updateItem(element)">
v-on:blur="updateContent(element)">
</div>
<div class="control">
<a class="button is-danger" v-on:click="deleteElement(element)">
@ -29,9 +29,12 @@ export default {
}
},
methods: {
updateItem: function () {
updateCheckbox: function () {
this.$emit('updateItem', {id: this.element.id, checked: this.element.checked}, true)
},
updateContent: function () {
this.$emit('updateItem', {id: this.element.id, content: this.element.content}, true)
},
deleteElement: function () {
this.$emit('deleteElement', this.element.id)
}

View File

@ -29,7 +29,8 @@
v-model="searchResults"
group="listItems"
@change="onChange"
item-key="id" v-if="searchQ.length <= 0">
item-key="id" v-if="searchQ.length <= 0"
handle=".handle">
<template #item="{element}">
<ListItem v-bind:item="element" v-bind:can-move="!element.checked" v-on:updateItem="updateItem" v-on:deleteElement="deleteElement"></ListItem>
</template>