todo-webclient/client/task-removal-modal.ls

29 lines
444 B
Plaintext
Raw Normal View History

2019-12-06 04:10:00 +01:00
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