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