v2.3.0-rc3

This commit is contained in:
2021-01-31 17:38:55 -03:00
parent c6dabb0627
commit afa90fb4bc
13 changed files with 292 additions and 56 deletions

View File

@ -441,6 +441,43 @@ let testimonios = {
}
}
let sticky_button = {
elem: $('#columna_sticky #side_button'),
setup: function() {
$('#modal_sticky').modal()
this.elem.click((e) => {
$('#modal_sticky').modal('show')
})
this.elem.sticky({
context: '#column'
})
}
}
let modal_sticky_form = {
elem: $('#modal_sticky form'),
color: null,
amount: null,
setup: function() {
this.amount = new Amount($('#modal_sticky form .input input[name="cantidad"]'))
this.color = new Colors($('#modal_sticky form .colores'), true)
this.elem.submit((e) => {
e.preventDefault()
this.submit()
this.elem.parent('#modal_sticky').modal('hide')
return false
})
},
submit: function() {
carro.add(this.elem.find('[name="cantidad"]').val(), this.elem.find('[name="color"]').val())
this.color.change_color('blue')
this.amount.n = 0
this.amount.print()
this.elem.trigger('reset')
}
}
let sticky = {
elem: $('#columna_sticky'),
setup: function() {
@ -455,9 +492,14 @@ let sticky = {
this.elem.find('.sticky .precio').html('$ ' + format(valor))
$('#columna_sticky .sticky').sticky({
context: '#column'
})
if ($('#columna_sticky .sticky').css('display') != 'none') {
$('#columna_sticky .sticky').sticky({
context: '#column'
})
} else {
sticky_button.setup()
modal_sticky_form.setup()
}
}
}
@ -477,6 +519,7 @@ let image = {
p.modal.find('.image').append(
$('<img />').attr('src', img)
)
p.modal.find('.image img').css('width', '100%')
p.modal.modal('show')
})
}