Ticket #8342: 8342_2.patch
File 8342_2.patch, 1.4 KB (added by , 13 years ago) |
---|
-
_source/plugins/clipboard/plugin.js
290 290 return retval; 291 291 } 292 292 293 var inReadOnly;294 293 function setToolbarStates() 295 294 { 296 295 if ( this.mode != 'wysiwyg' ) 297 296 return; 298 297 299 this.getCommand( 'cut' ).setState( inReadOnly ? CKEDITOR.TRISTATE_DISABLED : stateFromNamedCommand( 'Cut', this ) );298 this.getCommand( 'cut' ).setState( this.readOnly ? CKEDITOR.TRISTATE_DISABLED : stateFromNamedCommand( 'Cut', this ) ); 300 299 this.getCommand( 'copy' ).setState( stateFromNamedCommand( 'Copy', this ) ); 301 var pasteState = inReadOnly ? CKEDITOR.TRISTATE_DISABLED :300 var pasteState = this.readOnly ? CKEDITOR.TRISTATE_DISABLED : 302 301 CKEDITOR.env.webkit ? CKEDITOR.TRISTATE_OFF : stateFromNamedCommand( 'Paste', this ); 303 302 this.fire( 'pasteState', pasteState ); 304 303 } … … 411 410 body.on( 'keyup', setToolbarStates, editor ); 412 411 }); 413 412 414 // For improved performance, we're checking the readOnly state on selectionChange instead of hooking a key event for that.415 editor.on( 'selectionChange', function( evt )416 {417 inReadOnly = evt.data.selection.getRanges()[ 0 ].checkReadOnly();418 setToolbarStates.call( editor );419 });420 413 421 414 // If the "contextmenu" plugin is loaded, register the listeners. 422 415 if ( editor.contextMenu )