Updated MDI to match app version, and update icon while typing on popup

This commit is contained in:
keplyx 2020-02-26 12:11:44 +01:00
parent edf5641aff
commit 7eea3d2fe5
5 changed files with 10 additions and 4 deletions

File diff suppressed because one or more lines are too long

View file

@ -127,9 +127,10 @@ class ListManager {
} else if (this.editableTypes[i]['type'] === 'checkboxes') {
formData += this.getCategoryCheckboxes(defaultValues['id']);
} else {
if (this.editableTypes[i]['name'] === 'icon')
formData += "<i class='mdi mdi-" + value + "' style='margin-left: 5px'></i>";
if (this.editableTypes[i]['name'] === 'description')
if (this.editableTypes[i]['name'] === 'icon'){
formData += "<i id='" + inputId + "Icon' 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 + '" onchange="ListManager.onIconInputChange(this)" required />';
} else 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 />';
@ -139,6 +140,11 @@ class ListManager {
return formData;
}
static onIconInputChange(input) {
const id = $(input).attr('id') + 'Icon';
$('#' + id).attr('class', 'mdi mdi-' + $(input).val());
}
getImagePicker(id, index) {
let imageSrc = undefined;
if (index !== -1)