X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Fsourcearea%2Fplugin.js;h=2763e829474e5da3163c7dc78034bef1c9fe863a;hp=54f9d540258ec22fb8a1e35f653a4be5fff21951;hb=8761695d9b70afe75905deaac88f78c1f8aeb32d;hpb=ea7e3453c7b0f023b050aca6d9f83ab372860d91 diff --git a/_source/plugins/sourcearea/plugin.js b/_source/plugins/sourcearea/plugin.js index 54f9d54..2763e82 100644 --- a/_source/plugins/sourcearea/plugin.js +++ b/_source/plugins/sourcearea/plugin.js @@ -36,6 +36,7 @@ CKEDITOR.plugins.add( 'sourcearea', tabIndex : -1 }); textarea.addClass( 'cke_source' ); + textarea.addClass( 'cke_enable_context_menu' ); var styles = { @@ -63,6 +64,11 @@ CKEDITOR.plugins.add( 'sourcearea', textarea.show(); }; editor.on( 'resize', onResize ); + editor.on( 'afterCommandExec', function( event ) + { + if ( event.data.name == 'toolbarCollapse' ) + onResize(); + }); styles.height = holderElement.$.clientHeight + 'px'; } } @@ -74,9 +80,7 @@ CKEDITOR.plugins.add( 'sourcearea', // inside of it (non IE). textarea.on( 'mousedown', function( evt ) { - evt = evt.data.$; - if ( evt.stopPropagation ) - evt.stopPropagation(); + evt.data.stopPropagation(); } ); } @@ -86,6 +90,16 @@ CKEDITOR.plugins.add( 'sourcearea', holderElement.append( textarea ); textarea.setStyles( styles ); + textarea.on( 'blur', function() + { + editor.focusManager.blur(); + }); + + textarea.on( 'focus', function() + { + editor.focusManager.focus(); + }); + // The editor data "may be dirty" after this point. editor.mayBeDirty = true; @@ -107,6 +121,7 @@ CKEDITOR.plugins.add( 'sourcearea', loadData : function( data ) { textarea.setValue( data ); + editor.fire( 'dataReady' ); }, getData : function()