-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
on roadmapAccepted on to the roadmap for the given milestoneAccepted on to the roadmap for the given milestone
Description
Hi,
Users (admins really) became accustomed to this editor and there were scenarios (especially on our backend system), when a form based editor was needed. Eg editing a product desctiption on the admin instead of the frontend.
Also, using another, standard WYSIWYG editor led to some conflicts due to the HTML generated, so I had to cobble up a solution.
$('.js-content-tools-form').submit(function (event) {
let editor = ContentTools.EditorApp.get();
editor.removeEventListener('saved');
editor.stop(true);
let $form = $(event.target);
$form.find('[data-editable]').each(function (i, element) {
let $element = $(element);
let $input = $('<input type="hidden"></input>');
$input
.attr('name', $element.data('name'))
.val($element.html())
;
$form.append($input);
});
});
$('.form-content-tools').click(function () {
let editor = ContentTools.EditorApp.get();
if (!editor.isEditing()) {
editor.start();
}
});It would be nice to have some kind of form support built in.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
on roadmapAccepted on to the roadmap for the given milestoneAccepted on to the roadmap for the given milestone