todo-webclient/client/column-edit-modal.ls

49 lines
730 B
Plaintext
Raw Normal View History

2019-12-20 01:34:41 +01:00
{h} = require "maquette"
{field, control, input, label} = require "./bulma.ls"
Modal = require "./modal.ls"
Column = require './column.ls'
2019-12-20 01:34:41 +01:00
deep-copy = (object) ->
JSON.parse JSON.stringify object
ColumnEditModal = (project, column, args) ->
self = {
column: if column
deep-copy column
else
Column ""
2019-12-20 01:34:41 +01:00
on-validation: args.on-validation || (column) ->
}
modal = Modal {
+visible
content: [
field [
label "Column title"
control [
input {
value: self.column.title
oninput: (e) ->
self.column.title = e.target.value
}
]
]
]
on-validation: ->
self.on-validation self.column
}
self.render = ->
modal.render!
self
module.exports = ColumnEditModal