modularizated scripts

This commit is contained in:
2021-11-18 14:40:40 -03:00
parent ea76370282
commit b7e95b8d96
9 changed files with 377 additions and 335 deletions

24
scripts/stylesLogica.js Normal file
View File

@@ -0,0 +1,24 @@
const checkearCantidadDeElementos = () => {
const checkout = document.getElementsByClassName('checkout')[0]
const table = document.getElementById('products-display-checkout')
const tableContainer = table.parentElement
if (document.querySelector('#products-display-checkout tbody').children.length > 5) {
checkout.style.height = 'auto'
table.style.height = 'auto'
tableContainer.style.height = 'auto'
}
else {
checkout.style.height = '62vh'
table.style.height = 'auto'
tableContainer.style.height = '50vh'
}
}
export default checkearCantidadDeElementos