diff --git a/js/core/GUI.js b/js/core/GUI.js index 55512a2..e3ce95a 100644 --- a/js/core/GUI.js +++ b/js/core/GUI.js @@ -133,63 +133,67 @@ export class GUI // add a combobox or text areas for each entry in the dictionary: htmlCode += '
'; @@ -215,15 +219,15 @@ export class GUI // setup change event handlers for all required keys: - for (const key of this._requiredKeys) - { - const keyId = CSS.escape(key) + '_id'; - const input = document.getElementById(keyId); - if (input) + this._requiredKeys.forEach((keyId) => { - input.oninput = (event) => GUI._onKeyChange(self, event); + const input = document.getElementById(keyId); + if (input) + { + input.oninput = (event) => GUI._onKeyChange(self, event); + } } - } + ); // init and open the dialog box: self._dialogComponent.button = 'Cancel'; @@ -256,14 +260,16 @@ export class GUI { // update dictionary: - for (const key in dictionary) - { - const input = document.getElementById(CSS.escape(key) + "_id"); - if (input) + Object.keys(dictionary).forEach((key, keyIdx) => { - dictionary[key] = input.value; + const input = document.getElementById('form-input-' + keyIdx); + if (input) + { + dictionary[key] = input.value; + } } - } + ); + self._dialogComponent.button = 'OK'; $("#expDialog").dialog('close');