Ticket #8342: 8342_2.patch

File 8342_2.patch, 1.4 KB (added by Garry Yao, 13 years ago)
  • _source/plugins/clipboard/plugin.js

     
    290290                return retval;
    291291        }
    292292
    293         var inReadOnly;
    294293        function setToolbarStates()
    295294        {
    296295                if ( this.mode != 'wysiwyg' )
    297296                        return;
    298297
    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 ) );
    300299                this.getCommand( 'copy' ).setState( stateFromNamedCommand( 'Copy', this ) );
    301                 var pasteState = inReadOnly ? CKEDITOR.TRISTATE_DISABLED :
     300                var pasteState = this.readOnly ? CKEDITOR.TRISTATE_DISABLED :
    302301                                                CKEDITOR.env.webkit ? CKEDITOR.TRISTATE_OFF : stateFromNamedCommand( 'Paste', this );
    303302                this.fire( 'pasteState', pasteState );
    304303        }
     
    411410                                        body.on( 'keyup', setToolbarStates, editor );
    412411                                });
    413412
    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                                 });
    420413
    421414                                // If the "contextmenu" plugin is loaded, register the listeners.
    422415                                if ( editor.contextMenu )
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy