Luka Vandervelden
f4f043f4e1
A .visible-on-hover class has also been added, although it isn’t very flexible at the moment.
49 lines
730 B
Plaintext
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
|
|
|