¨4.0.1¨
This commit is contained in:
@@ -3,7 +3,7 @@ export default class {
|
||||
this.attributeId = 0;
|
||||
this.valuesCount = 0;
|
||||
|
||||
this.addOldValues(FleetCart.data['attribute.values']);
|
||||
this.addOldValues(FleetCart.data["attribute.values"]);
|
||||
|
||||
if (this.valuesCount === 0) {
|
||||
this.addAttributeValue();
|
||||
@@ -12,7 +12,7 @@ export default class {
|
||||
this.eventListeners();
|
||||
this.sortable();
|
||||
|
||||
window.admin.removeSubmitButtonOffsetOn('#values');
|
||||
window.admin.removeSubmitButtonOffsetOn("#values");
|
||||
}
|
||||
|
||||
addOldValues(values = {}) {
|
||||
@@ -21,26 +21,26 @@ export default class {
|
||||
}
|
||||
}
|
||||
|
||||
addAttributeValue(value = { id: '', value: '' }) {
|
||||
let template = _.template($('#attribute-value-template').html());
|
||||
addAttributeValue(value = { id: "", value: "" }) {
|
||||
let template = _.template($("#attribute-value-template").html());
|
||||
let html = template({ valueId: this.valuesCount++, value });
|
||||
|
||||
$('#attribute-values').append(html);
|
||||
$("#attribute-values").append(html);
|
||||
|
||||
window.admin.tooltip();
|
||||
}
|
||||
|
||||
eventListeners() {
|
||||
$('#add-new-value').on('click', () => this.addAttributeValue());
|
||||
$("#add-new-value").on("click", () => this.addAttributeValue());
|
||||
|
||||
$('#attribute-values').on('click', '.delete-row', (e) => {
|
||||
$(e.currentTarget).closest('tr').remove();
|
||||
$("#attribute-values").on("click", ".delete-row", (e) => {
|
||||
$(e.currentTarget).closest("tr").remove();
|
||||
});
|
||||
}
|
||||
|
||||
sortable() {
|
||||
Sortable.create(document.getElementById('attribute-values'), {
|
||||
handle: '.drag-icon',
|
||||
Sortable.create(document.getElementById("attribute-values"), {
|
||||
handle: ".drag-handle",
|
||||
animation: 150,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user