Fix ISBN script

This commit is contained in:
Gabriel Augendre 2019-06-01 21:10:29 +02:00
parent bb7109ff7c
commit e885e82acd

View file

@ -63,14 +63,16 @@ document.addEventListener("DOMContentLoaded", function (event) {
var editorValue = ""; var editorValue = "";
var editorIsOther = false; var editorIsOther = false;
for (var option of document.querySelector('#id_editor').children) { if (data.editor) {
if (editorValue === "" && option.firstChild.data.toLowerCase().indexOf('autre') !== -1) { for (var option of document.querySelector('#id_editor').children) {
editorValue = option.value; if (editorValue === "" && option.firstChild.data.toLowerCase().indexOf('autre') !== -1) {
editorIsOther = true; editorValue = option.value;
} editorIsOther = true;
if (option.firstChild.data.toLowerCase() === data.editor.toLowerCase()) { }
editorValue = option.value; if (option.firstChild.data.toLowerCase() === data.editor.toLowerCase()) {
editorIsOther = false; editorValue = option.value;
editorIsOther = false;
}
} }
} }
editor.value = editorValue; editor.value = editorValue;