¨4.0.1¨

This commit is contained in:
¨NW¨
2023-12-03 14:07:47 +00:00
parent c08b36d1b6
commit f35052522d
1112 changed files with 43019 additions and 24987 deletions

View File

@@ -4,13 +4,13 @@ export default class {
constructor() {
this.rateCount = 0;
this.addTaxRates(FleetCart.data['tax_rates']);
this.addTaxRates(FleetCart.data["tax_rates"]);
if (this.rateCount === 0) {
this.addTaxRate();
}
this.addTaxRatesErrors(FleetCart.errors['tax_rates']);
this.addTaxRatesErrors(FleetCart.errors["tax_rates"]);
this.eventListeners();
this.sortable();
@@ -18,14 +18,14 @@ export default class {
addTaxRates(rates) {
for (let rate of rates) {
this.addTaxRate(rate)
this.addTaxRate(rate);
}
}
addTaxRate(rate = {}) {
let textRate = new TaxRate(this.rateCount++, rate);
$('#tax-rates').append(textRate.html());
$("#tax-rates").append(textRate.html());
textRate.updateState();
@@ -37,18 +37,18 @@ export default class {
let id = $.escapeSelector(key);
let parent = $(`#${id}`).parent();
parent.addClass('has-error');
parent.addClass("has-error");
parent.append(`<span class="help-block">${errors[key][0]}</span>`);
}
}
eventListeners() {
$('#add-new-rate').on('click', () => this.addTaxRate());
$("#add-new-rate").on("click", () => this.addTaxRate());
}
sortable() {
Sortable.create(document.getElementById('tax-rates'), {
handle: '.drag-icon',
Sortable.create(document.getElementById("tax-rates"), {
handle: ".drag-handle",
animation: 150,
});
}