Upgrades to the UI
This commit is contained in:
@ -210,29 +210,38 @@ class TipoCategoria {
|
||||
}
|
||||
}
|
||||
const cuentas = {
|
||||
id: 'cuentas',
|
||||
id: '#cuentas',
|
||||
balance: 0,
|
||||
tipos: [],
|
||||
tipos_categorias: [],
|
||||
build: function() {
|
||||
return {
|
||||
parent: (segment) => {
|
||||
const tr = $('<tr></tr>').append(
|
||||
$('<th></th>').attr('colspan', 3).html('Cuenta')
|
||||
)
|
||||
$.each(this.tipos, (i, el) => {
|
||||
tr.append(
|
||||
$('<th></th>').attr('class', 'right aligned').css('color', '#' + el.color).html(el.descripcion)
|
||||
)
|
||||
})
|
||||
const table = $('<table></table>').attr('class', 'ui striped table').append(
|
||||
$('<thead></thead>').append(tr)
|
||||
)
|
||||
const parent = $('<tbody></tbody>')
|
||||
table.append(parent)
|
||||
segment.append(table)
|
||||
return parent
|
||||
}
|
||||
}
|
||||
},
|
||||
get: function() {
|
||||
return {
|
||||
parent: () => {
|
||||
let parent = $('#' + this.id)
|
||||
const segment = $(this.id)
|
||||
let parent = segment.find('tbody')
|
||||
if (parent.length === 0) {
|
||||
const tr = $('<tr></tr>').append(
|
||||
$('<th></th>').attr('colspan', 3).html('Cuenta')
|
||||
)
|
||||
$.each(this.tipos, (i, el) => {
|
||||
tr.append(
|
||||
$('<th></th>').attr('class', 'right aligned').css('color', '#' + el.color).html(el.descripcion)
|
||||
)
|
||||
})
|
||||
const table = $('<table></table>').attr('class', 'ui striped table').append(
|
||||
$('<thead></thead>').append(tr)
|
||||
)
|
||||
parent = $('<tbody></tbody>').attr('id', this.id)
|
||||
table.append(parent)
|
||||
$('h1.header').after(table)
|
||||
parent = this.build().parent(segment)
|
||||
}
|
||||
return parent
|
||||
},
|
||||
|
Reference in New Issue
Block a user