mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-07-02 23:54:28 -06:00
Merge pull request #223 from nick-denry/fix_to_textarea
Fix toTextArea issue
This commit is contained in:
commit
5a5bb97a20
@ -2743,19 +2743,24 @@ EasyMDE.prototype.getState = function () {
|
|||||||
EasyMDE.prototype.toTextArea = function () {
|
EasyMDE.prototype.toTextArea = function () {
|
||||||
var cm = this.codemirror;
|
var cm = this.codemirror;
|
||||||
var wrapper = cm.getWrapperElement();
|
var wrapper = cm.getWrapperElement();
|
||||||
|
var easyMDEContainer = wrapper.parentNode;
|
||||||
|
|
||||||
if (wrapper.parentNode) {
|
if (easyMDEContainer) {
|
||||||
if (this.gui.toolbar) {
|
if (this.gui.toolbar) {
|
||||||
wrapper.parentNode.removeChild(this.gui.toolbar);
|
easyMDEContainer.removeChild(this.gui.toolbar);
|
||||||
}
|
}
|
||||||
if (this.gui.statusbar) {
|
if (this.gui.statusbar) {
|
||||||
wrapper.parentNode.removeChild(this.gui.statusbar);
|
easyMDEContainer.removeChild(this.gui.statusbar);
|
||||||
}
|
}
|
||||||
if (this.gui.sideBySide) {
|
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();
|
cm.toTextArea();
|
||||||
|
|
||||||
if (this.autosaveTimeoutId) {
|
if (this.autosaveTimeoutId) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user