Custom modal screen in TinyMCE 4 plugin in inline mode -
i developing custom plugin new tinymce 4. plugin utilizes modal screen. because want use modal screen/js service developed chose not use tinymce's window manager.
the problem tinymce looses focus open open modal screen. want tinymce keep toolbars opened, because otherwise cannot interact editor. tinymce closes because receives blur event (and because not know opened windows).
an minified problem showing problem can found in following fiddle. problem occurs example button clicked. http://fiddle.tinymce.com/pudaab/1
the shortened code attached below:
tinymce.pluginmanager.add('example', function(editor, url) { // add button opens window editor.addbutton('example', { text: 'my button', icon: false, onclick: function() { var selection = editor.selection, dom = editor.dom, selectedelm, anchorelm; // focus editor since selection lost on webkit in inline mode editor.focus(); // open modal screen using bootstrap $('#elem').modal(); // note: modal opens tinymce receives blur event , disables toolbar } }); });
i managed solve myself. trick call editor.nodechanged()
before calling modal screen. when close modal screen call editor.focus()
.
thanks though!
Comments
Post a Comment