mirror of
https://git.imnavajas.es/jjimenez/erp-imprimelibros.git
synced 2026-01-24 09:40:21 +00:00
primer commit. añadido tema Velzon
This commit is contained in:
@ -0,0 +1,48 @@
|
||||
/*
|
||||
Template Name: Velzon - Admin & Dashboard Template
|
||||
Author: Themesbrand
|
||||
Website: https://Themesbrand.com/
|
||||
Contact: Themesbrand@gmail.com
|
||||
File: Form input spin Js File
|
||||
*/
|
||||
|
||||
// input spin
|
||||
isData();
|
||||
|
||||
function isData() {
|
||||
var plus = document.getElementsByClassName('plus');
|
||||
var minus = document.getElementsByClassName('minus');
|
||||
var product = document.getElementsByClassName("product");
|
||||
|
||||
if (plus) {
|
||||
Array.from(plus).forEach(function (e) {
|
||||
e.addEventListener('click', function (event) {
|
||||
// if(event.target.previousElementSibling.value )
|
||||
if (parseInt(e.previousElementSibling.value) < event.target.previousElementSibling.getAttribute('max')) {
|
||||
event.target.previousElementSibling.value++;
|
||||
if (product) {
|
||||
Array.from(product).forEach(function (x) {
|
||||
updateQuantity(event.target);
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if (minus) {
|
||||
Array.from(minus).forEach(function (e) {
|
||||
e.addEventListener('click', function (event) {
|
||||
if (parseInt(e.nextElementSibling.value) > event.target.nextElementSibling.getAttribute('min')) {
|
||||
event.target.nextElementSibling.value--;
|
||||
if (product) {
|
||||
Array.from(product).forEach(function (x) {
|
||||
updateQuantity(event.target);
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user