Ticket #6020: 6020.patch
File 6020.patch, 1.5 KB (added by , 13 years ago) |
---|
-
_source/plugins/clipboard/plugin.js
1 /*1 /* 2 2 Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. 3 3 For licensing, see LICENSE.html or http://ckeditor.com/license 4 4 */ … … 342 342 343 343 var mode = editor.config.forcePasteAsPlainText ? 'text' : 'html'; 344 344 345 function manageButtonState() 346 { 347 var commandCut = editor.getCommand( 'cut' ), 348 commandCopy = editor.getCommand( 'copy' ); 349 350 if( editor.getSelection().getRanges()[0].collapsed ) 351 { 352 commandCut.setState( CKEDITOR.TRISTATE_DISABLED ); 353 commandCopy.setState( CKEDITOR.TRISTATE_DISABLED ); 354 } 355 else 356 { 357 commandCut.setState( CKEDITOR.TRISTATE_OFF ); 358 commandCopy.setState( CKEDITOR.TRISTATE_OFF ); 359 } 360 } 361 345 362 // We'll be catching all pasted content in one line, regardless of whether the 346 363 // it's introduced by a document command execution (e.g. toolbar buttons) or 347 364 // user paste behaviors. (e.g. Ctrl-V) … … 368 385 }); 369 386 370 387 body.on( 'beforecut', function() { !depressBeforeEvent && fixCut( editor ); } ); 388 389 body.on( 'mouseup', manageButtonState ); 390 391 editor.document.on( 'keyup', manageButtonState ); 371 392 }); 372 393 373 394 // If the "contextmenu" plugin is loaded, register the listeners.