2
0
mirror of https://github.com/Ionaru/easy-markdown-editor synced 2025-07-17 15:04:28 -06:00
This commit is contained in:
Nick Denry 2020-08-09 17:43:10 +03:00
parent 55312d8ec3
commit 8b177f9c05

View File

@ -2745,22 +2745,22 @@ EasyMDE.prototype.toTextArea = function () {
var wrapper = cm.getWrapperElement();
var easyMDEContainer = wrapper.parentNode;
if (wrapper.parentNode) {
if (easyMDEContainer) {
if (this.gui.toolbar) {
wrapper.parentNode.removeChild(this.gui.toolbar);
easyMDEContainer.removeChild(this.gui.toolbar);
}
if (this.gui.statusbar) {
wrapper.parentNode.removeChild(this.gui.statusbar);
easyMDEContainer.removeChild(this.gui.statusbar);
}
if (this.gui.sideBySide) {
wrapper.parentNode.removeChild(this.gui.sideBySide);
easyMDEContainer.removeChild(this.gui.sideBySide);
}
}
// Unwrap easyMDEcontainer before codemirror toTextArea() call
easyMDEContainer.parentNode.insertBefore(wrapper, easyMDEContainer);
easyMDEContainer.remove();
cm.toTextArea();
if (this.autosaveTimeoutId) {