Skip to content

Commit 2a21220

Browse files
authored
Merge pull request #2311 from laws-africa/fix-full-edit
check parentNode, _not_ parentElement (null when editing Entire document)
2 parents 51c827e + 268d70f commit 2a21220

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

indigo_app/static/javascript/indigo/views/document_editor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
if (elements.length) {
143143
this.onTextElementParsed(elements);
144144
this.closeTextEditor();
145-
} else if (this.xmlElement.parentElement.tagName === 'portionBody') {
145+
} else if (this.xmlElement.parentNode.tagName === 'portionBody') {
146146
alert($t('You cannot delete the whole provision in provision editing mode.'));
147147
} else if (confirm($t('Go ahead and delete this provision from the document?'))) {
148148
this.parent.removeFragment(this.editingXmlElement);

indigo_app/static/javascript/indigo/views/document_xml_editor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ class AknTextEditor {
136136
let newElement = $.parseXML(xml);
137137

138138
// if the top-level eId changed in provision mode, reload the page when saving later (just set the flag here)
139-
if (this.xmlElement.parentElement.tagName === 'portionBody') {
139+
if (this.xmlElement.parentNode.tagName === 'portionBody') {
140140
// set it back to false if the eId is changed back before saving too
141141
this.reloadOnSave = newElement.firstChild.firstChild.getAttribute('eId') !== Indigo.Preloads.provisionEid;
142142
}

0 commit comments

Comments
 (0)