Kaynağa Gözat

Renamed readOnly to isReadOnly.

Oskar Wróbel 8 yıl önce
ebeveyn
işleme
8faa94fc5f

+ 2 - 2
packages/ckeditor5-core/src/command.js

@@ -20,7 +20,7 @@ import mix from '@ckeditor/ckeditor5-utils/src/mix';
  * Instances of registered commands can be retrieved from {@link module:core/editor/editor~Editor#commands}.
  * The easiest way to execute a command is through {@link module:core/editor/editor~Editor#execute}.
  *
- * By default commands are disabled when editor is in {@link module:core/editor/editor~Editor#readOnly read-only} mode.
+ * By default commands are disabled when editor is in {@link module:core/editor/editor~Editor#isReadOnly read-only} mode.
  *
  * @mixes module:utils/observablemixin~ObservableMixin
  */
@@ -77,7 +77,7 @@ export default class Command {
 		}, { priority: 'high' } );
 
 		// By default commands are disabled when editor switches to read-only mode.
-		this.listenTo( editor, 'change:readOnly', ( evt, name, value ) => {
+		this.listenTo( editor, 'change:isReadOnly', ( evt, name, value ) => {
 			if ( value ) {
 				this.on( 'change:isEnabled', forceDisable, { priority: 'high' } );
 				this.isEnabled = false;

+ 2 - 2
packages/ckeditor5-core/src/editor/editor.js

@@ -94,9 +94,9 @@ export default class Editor {
 		 * are disabled and is not possible to set any data to the editor.
 		 *
 		 * @observable
-		 * @member {Boolean} #readOnly
+		 * @member {Boolean} #isReadOnly
 		 */
-		this.set( 'readOnly', false );
+		this.set( 'isReadOnly', false );
 
 		/**
 		 * Instance of the {@link module:engine/controller/editingcontroller~EditingController editing controller}.

+ 3 - 3
packages/ckeditor5-core/tests/command.js

@@ -67,10 +67,10 @@ describe( 'Command', () => {
 		} );
 
 		it( 'is always falsy when the editor is in read-only mode', () => {
-			editor.readOnly = false;
+			editor.isReadOnly = false;
 			command.isEnabled = true;
 
-			editor.readOnly = true;
+			editor.isReadOnly = true;
 
 			// Is false.
 			expect( command.isEnabled ).to.false;
@@ -80,7 +80,7 @@ describe( 'Command', () => {
 			// Still false.
 			expect( command.isEnabled ).to.false;
 
-			editor.readOnly = false;
+			editor.isReadOnly = false;
 
 			// And is back to true.
 			expect( command.isEnabled ).to.true;

+ 4 - 4
packages/ckeditor5-core/tests/editor/editor.js

@@ -158,20 +158,20 @@ describe( 'Editor', () => {
 		} );
 	} );
 
-	describe( 'readOnly', () => {
+	describe( 'isReadOnly', () => {
 		it( 'is false at default', () => {
 			const editor = new Editor();
 
-			expect( editor.readOnly ).to.false;
+			expect( editor.isReadOnly ).to.false;
 		} );
 
 		it( 'is observable', () => {
 			const editor = new Editor();
 			const spy = sinon.spy();
 
-			editor.on( 'change:readOnly', spy );
+			editor.on( 'change:isReadOnly', spy );
 
-			editor.readOnly = true;
+			editor.isReadOnly = true;
 
 			sinon.assert.calledOnce( spy );
 		} );