¨4.0.1¨
This commit is contained in:
@@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user