romanvm / django-tinymce4-lite

TinyMCE 4 editor widget for Django
MIT License
126 stars 47 forks source link

Changing setup parameters in TinyMCE config #40

Closed AnsonLai closed 6 years ago

AnsonLai commented 6 years ago

I'm trying to change the initialization parameters for TinyMCE. In particular I'm trying to change the setup parameter so that I can run a command on change.

I've tried to add to TINYMCE_CALLBACKS but the format doesn't come out right. "setup": "function(editor){editor.on('change',function(){editor.save();console.log('CHANGED');});}",

The default setup still exists and I cannot override it. I'm just wondering if I'm going about this the wrong way.

EDIT: Tried using TINYMCE_CALLBACKS

AnsonLai commented 6 years ago

Sorry, problem solved. Of course it starts working as soon as I post the question.

For anyone else with this problem, use TINYMCE_CALLBACKS and: "init_instance_callback": "function(editor){editor.on('change',function(){editor.save();console.log('CHANGED');});}",