todo-webclient/client/column-edit-modal.ls
Luka Vandervelden f4f043f4e1 Columns can be added and removed again.
A .visible-on-hover class has also been added, although it isn’t very
flexible at the moment.
2019-12-22 20:03:11 +01:00

49 lines
730 B
Plaintext

{h} = require "maquette"
{field, control, input, label} = require "./bulma.ls"
Modal = require "./modal.ls"
Column = require './column.ls'
deep-copy = (object) ->
JSON.parse JSON.stringify object
ColumnEditModal = (project, column, args) ->
self = {
column: if column
deep-copy column
else
Column ""
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