jQuery(() => {
/**
* This removes unintended elements created by other plugins and broken for structsection
*
* Currently it removes the edit-button shown by edittable, which cannot work inside this plugin
*
* @returns {void}
*/
function cleanOtherPlugins() {
jQuery('#plugin__structsection_output').find('.editbutton_table').remove();
}
cleanOtherPlugins();
jQuery('#plugin__structsection_output').on('submit', 'form.btn_secedit', function handleEdit(e) {
e.preventDefault();
e.stopPropagation();
const $self = jQuery(this).parent().prev().find('div.level2'); // fixme: too fragile!
const pid = JSINFO.id;
const field = $self.data('struct');
const { rev } = JSINFO.plugin_structsection;
const rid = 0;
if (!pid) return;
if (!field) return;
// prepare the edit overlay
const $div = jQuery('