X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fsourcearea%2Fplugin.js;h=ca2d3075c82764c8c47613418063a45d52e7fc23;hb=941b0a9ba4e673e292510d80a5a86806994b8ea6;hp=54f9d540258ec22fb8a1e35f653a4be5fff21951;hpb=ea7e3453c7b0f023b050aca6d9f83ab372860d91;p=ckeditor.git diff --git a/_source/plugins/sourcearea/plugin.js b/_source/plugins/sourcearea/plugin.js index 54f9d54..ca2d307 100644 --- a/_source/plugins/sourcearea/plugin.js +++ b/_source/plugins/sourcearea/plugin.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -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()