问题
I am trying to insert multiple files in Froala editor. Each File has to show different linkEditButtons based on some conditions.
LinkEditButtons are not shown correctly. The alerts below shows correct buttons . But editor is not getting updated.
How should I get the updated editor instance .
$("#froala").on("froalaEditor.file.inserted", function (e, editor, files) {
var editor= $('#froala').data('froala.editor');
var url = editor.link.get(); alert("editor.opts.linkEditButtons" + editor.opts.linkEditButtons);
var base = 'pdf;base64';
if (files[0].href.indexOf(base) !== -1) {
editor.opts.linkEditButtons = ['linkRemove'];
alert("editor.opts.linkEditButtons" + editor.opts.linkEditButtons);
} else {
editor.opts.linkEditButtons = ['linkOpen', 'linkRemove'];
alert("editor.opts.linkEditButtons" + editor.opts.linkEditButtons);
}
来源:https://stackoverflow.com/questions/56669183/froala-editor-is-not-showing-correct-linkeditbuttons