Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrammatiko committed May 31, 2020
1 parent b1f9734 commit 7c5546d
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions build/media_source/plg_editors_tinymce/js/tinymce.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,13 @@
}

// We'll take over the onSubmit event
options.add_form_submit_trigger = false;
options.init_instance_callback = (editor) => {
editor.on('submit', () => {
if (editor.isHidden()) {
editor.show();
}
}, true);
};

// Create a new instance
// eslint-disable-next-line no-undef
Expand All @@ -155,17 +161,8 @@
// Some extra instance dependent
id: element.id,
instance: ed,
onSave: () => {
if (Joomla.editors.instances[element.id].instance.isHidden()) {
Joomla.editors.instances[element.id].instance.show();
}
},
};

/** On save * */
document.getElementById(ed.id).form.addEventListener('submit', () => Joomla.editors.instances[ed.targetElm.id].onSave());
},

};

/**
Expand Down

0 comments on commit 7c5546d

Please sign in to comment.