Selaa lähdekoodia

Merge pull request #1030 from ckeditor/t/1028

Internal: Removed isReadOnly state from EditingController. Closes #1028.
Piotr Jasiun 8 vuotta sitten
vanhempi
sitoutus
6c5b29c450

+ 0 - 13
packages/ckeditor5-engine/src/controller/editingcontroller.js

@@ -63,19 +63,6 @@ export default class EditingController {
 		 */
 		this.mapper = new Mapper();
 
-		/**
-		 * Defines whether controller is in read-only mode.
-		 *
-		 * When controller is read-ony then {module:engine/view/document~Document view document} is read-only as well.
-		 *
-		 * @observable
-		 * @member {Boolean} #isReadOnly
-		 */
-		this.set( 'isReadOnly', false );
-
-		// When controller is read-only the view document is read-only as well.
-		this.view.bind( 'isReadOnly' ).to( this );
-
 		/**
 		 * Model to view conversion dispatcher, which converts changes from the model to
 		 * {@link #view editing view}.

+ 0 - 11
packages/ckeditor5-engine/tests/controller/editingcontroller.js

@@ -45,7 +45,6 @@ describe( 'EditingController', () => {
 			expect( editing ).to.have.property( 'view' ).that.is.instanceof( ViewDocument );
 			expect( editing ).to.have.property( 'mapper' ).that.is.instanceof( Mapper );
 			expect( editing ).to.have.property( 'modelToView' ).that.is.instanceof( ModelConversionDispatcher );
-			expect( editing ).to.have.property( 'isReadOnly' ).that.is.false;
 
 			editing.destroy();
 		} );
@@ -58,16 +57,6 @@ describe( 'EditingController', () => {
 
 			sinon.assert.calledOnce( spy );
 		} );
-
-		it( 'should bind view#isReadOnly to controller#isReadOnly', () => {
-			editing.isReadOnly = false;
-
-			expect( editing.view.isReadOnly ).to.false;
-
-			editing.isReadOnly = true;
-
-			expect( editing.view.isReadOnly ).to.true;
-		} );
 	} );
 
 	describe( 'createRoot()', () => {