Reputation: 143
Froala v2 has removed the "option" method in v2. Is it possible to change options after the editor has been initialized? Something like this:
var $title = $('#title');
$edit.on('froalaEditor.save.before', function (e, editor) {
$edit.froalaEditor('option', 'saveParams', {
title: $title.val()
});
});
Upvotes: 0
Views: 2318
Reputation: 543
How to get the Froala editor instance:
var editor = $('.textarea-selector').data('froala.editor')
Then you can reconfigure your Froala:
var newOpts = {saveParams: {title: $title.val()}}
$.extend(editor.opts, newOpts)
https://github.com/froala/wysiwyg-editor/issues/53
Upvotes: 3
Reputation: 1
Try as shown below.
var $title = $('#title');
$edit.on('froalaEditor.save.before', function (e, editor) {
$.extend(editor.opts.saveParams, {
title : $title.val()
});
});
Upvotes: 0