Upgrades to the UI

This commit is contained in:
2021-12-23 00:46:56 -03:00
parent 9e29dd09b7
commit 4abe3448c0
11 changed files with 96 additions and 63 deletions

View File

@ -57,31 +57,40 @@ const archivos = {
add: null,
edit: null
},
get: function() {
build: function() {
return {
parent: () => {
let parent = $(this.id).find('tbody')
if (parent.length === 0) {
const table = $('<table></table>').attr('class', 'ui striped table').append(
$('<thead></thead>').append(
$('<tr></tr>').append(
$('<th></th>').html('Archivo')
).append(
$('<th></th>').attr('class', 'right aligned').append(
$('<button></button>').attr('class', 'ui tiny green circular icon button').append(
$('<i></i>').attr('class', 'plus icon')
).click((e) => {
e.preventDefault()
this.add()
return false
})
)
parent: (segment) => {
const table = $('<table></table>').attr('class', 'ui striped table').append(
$('<thead></thead>').append(
$('<tr></tr>').append(
$('<th></th>').html('Archivo')
).append(
$('<th></th>').attr('class', 'right aligned').append(
$('<button></button>').attr('class', 'ui tiny green circular icon button').append(
$('<i></i>').attr('class', 'plus icon')
).click((e) => {
e.preventDefault()
this.add()
return false
})
)
)
)
parent = $('<tbody></tbody>')
table.append(parent)
$(this.id).append(table)
)
const parent = $('<tbody></tbody>')
table.append(parent)
segment.append(table)
return parent
}
}
},
get: function() {
return {
parent: () => {
const segment = $(this.id)
let parent = segment.find('tbody')
if (parent.length === 0) {
parent = this.build().parent(segment)
}
return parent
},