javascript - Change CKEditor Keystrokes at runtime -
i want change keystrokes config of ckeditor @ runtime.
my goal: ctr+enter should submit form.
unfortunately can't configure ckeditor via js-configuration, since use django-ckeditor (related issue #322)
i tried this:
$(function() { ckeditor.on( 'instanceready', function( evt ) { for(x in ckeditor.instances){ var instance = ckeditor.instances[x]; instance.config.keystrokes.push([ ctrl + 13 /* enter */, 'save' ]); }; }) })
... get:
typeerror: instance.config.keystrokes undefined
how can modify configuration of ckeditor make ctrl+enter submit form?
you can use ckeditor.editor.setkeystroke (note small 's' in 'save'):
ckeditor.on('instanceready', function(evt) { evt.editor.setkeystroke(ckeditor.ctrl + 13, 'save'); })
Comments
Post a Comment