Improved article management

This commit is contained in:
keplyx 2020-02-26 11:50:26 +01:00
parent b46717d982
commit edf5641aff
2 changed files with 9 additions and 5 deletions

View file

@ -48,6 +48,8 @@
width: 200px;
height: 50px;
overflow: hidden;
font-size: 0.8rem;
line-height: 25px;
}
.list-price {

View file

@ -129,8 +129,10 @@ class ListManager {
} else {
if (this.editableTypes[i]['name'] === 'icon')
formData += "<i class='mdi mdi-" + value + "' style='margin-left: 5px'></i>";
formData += '<input name="' + inputName + '" id="' + inputId + '" type="' + inputType + '" placeholder="Entrez une valeur" class="form-control" value="' + value + '" required />';
if (this.editableTypes[i]['name'] === 'description')
formData += '<textarea name="' + inputName + '" id="' + inputId + '" type="' + inputType + '" placeholder="Entrez une valeur" class="form-control" required >' + value + '</textarea>';
else
formData += '<input name="' + inputName + '" id="' + inputId + '" type="' + inputType + '" placeholder="Entrez une valeur" class="form-control" value="' + value + '" required />';
}
}
formData += "</div></form>";
@ -210,9 +212,7 @@ class ListManager {
if (index === -1)
index = this.displayedData.length - 1;
let iconContainer = this.displayedData[index].find(".list-category");
for (let i = 0; i < categories.length; i++) {
iconContainer.html(this.getCategoryIcons(this.currentData[index]['id']));
}
iconContainer.html(this.getCategoryIcons(this.currentData[index]['id']));
}
updateAssociationList(articleId, newCategories) {
@ -229,6 +229,8 @@ class ListManager {
}
updateArticleImage(image, index) {
if (index === -1)
index = this.displayedData.length - 1;
$(this.displayedData[index].find("img")[0]).attr('src', window.URL.createObjectURL(image));
}