diff --git a/indigo_app/static/javascript/indigo/views/document_editor.js b/indigo_app/static/javascript/indigo/views/document_editor.js index 88ea9c17d..904de7e96 100644 --- a/indigo_app/static/javascript/indigo/views/document_editor.js +++ b/indigo_app/static/javascript/indigo/views/document_editor.js @@ -137,12 +137,14 @@ btn.removeAttribute('disabled'); } - if (elements && elements.length) { - this.onTextElementParsed(elements); - this.closeTextEditor(); - } else if (confirm($t('Go ahead and delete this section from the document?'))) { - this.parent.removeFragment(this.editingXmlElement); - this.closeTextEditor(); + if (elements) { + if (elements.length) { + this.onTextElementParsed(elements); + this.closeTextEditor(); + } else if (confirm($t('Go ahead and delete this section from the document?'))) { + this.parent.removeFragment(this.editingXmlElement); + this.closeTextEditor(); + } } }, diff --git a/indigo_app/static/javascript/indigo/views/document_xml_editor.js b/indigo_app/static/javascript/indigo/views/document_xml_editor.js index 2e555e2b0..66a277ef7 100644 --- a/indigo_app/static/javascript/indigo/views/document_xml_editor.js +++ b/indigo_app/static/javascript/indigo/views/document_xml_editor.js @@ -140,6 +140,8 @@ class AknTextEditor { } else { Indigo.errorView.show(resp.statusText); } + + return null; } toggleWordWrap (e) {