Task lists WIP:

* Fix drag & drop
This commit is contained in:
John Livingston 2024-05-09 13:54:42 +02:00
parent 0d0771e684
commit 7e56c845fe
No known key found for this signature in database
GPG Key ID: B17B5640CE66CDBC
3 changed files with 6 additions and 4 deletions

View File

@ -112,9 +112,11 @@ export default class MUCTaskListsView extends CustomElement {
} }
_handleDragStart (ev) { _handleDragStart (ev) {
if (!this._isATaskEl(ev.target)) { return } // The draggable=true is on a livechat-converse-muc-task child
const possibleTaskEl = ev.target.parentElement
if (!this._isATaskEl(possibleTaskEl)) { return }
console.log('Starting to drag a task...') console.log('Starting to drag a task...')
this.currentDraggedTask = ev.target this.currentDraggedTask = possibleTaskEl
this._resetDropOver() this._resetDropOver()
} }

View File

@ -67,7 +67,7 @@ export default function tplMucTaskList (el, tasklist) {
${el.collapsed ${el.collapsed
? '' ? ''
: repeat(tasks, (task) => task.get('id'), (task) => { : repeat(tasks, (task) => task.get('id'), (task) => {
return html`<livechat-converse-muc-task .model=${task} draggable="true"></livechat-converse-muc-task>` return html`<livechat-converse-muc-task .model=${task}></livechat-converse-muc-task>`
}) })
} }
</div> </div>

View File

@ -9,7 +9,7 @@ export function tplMucTask (el, task) {
const doneId = 'livechat-task-done-id-' + task.get('id') const doneId = 'livechat-task-done-id-' + task.get('id')
return !el.edit return !el.edit
? html` ? html`
<div class="task-line" ?task-is-done=${done}> <div draggable="true" class="task-line" ?task-is-done=${done}>
<div class="form-check"> <div class="form-check">
<input <input
id="${doneId}" id="${doneId}"