todo-webclient/client/task-removal-modal.ls
Philippe PITTOLI 0e7fdb9ecf task modals
2019-12-06 04:10:00 +01:00

29 lines
444 B
Plaintext

h = require 'maquette' .h
Modal = require './modal.ls'
TaskRemovalModal = (project-id, todod-ws, task) ->
task ||= {}
self = {
title: task.title || ""
description: task.description || ""
}
modal = Modal {
+visible
content: h \div.is-danger [ "Do you want to remove the task ?" ]
on-validation: ->
if task.id
todod-ws.remove-task task.id
}
self.render = ->
modal.render!
self
module.exports = TaskRemovalModal