Ver código fonte

Removed root#isReadOnly binding from EditingController.

Oskar Wróbel 8 anos atrás
pai
commit
454b11c384

+ 1 - 5
packages/ckeditor5-engine/src/controller/editingcontroller.js

@@ -66,8 +66,7 @@ export default class EditingController {
 		/**
 		 * Defines whether controller is in read-only mode.
 		 *
-		 * When controller is read-ony {module:engine/view/document~Document view document} and all view roots
-		 * are read-only as well.
+		 * When controller is read-ony then {module:engine/view/document~Document view document} is read-only as well.
 		 *
 		 * @observable
 		 * @member {Boolean} #isReadOnly
@@ -157,9 +156,6 @@ export default class EditingController {
 
 		this.mapper.bindElements( modelRoot, viewRoot );
 
-		// When controller is read-only the all view roots are read-only as well.
-		viewRoot.bind( 'isReadOnly' ).to( this );
-
 		return viewRoot;
 	}
 

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

@@ -134,19 +134,6 @@ describe( 'EditingController', () => {
 			expect( editing.mapper.toModelElement( viewRoot ) ).to.equal( modelRoot );
 			expect( editing.mapper.toViewElement( modelRoot ) ).to.equal( viewRoot );
 		} );
-
-		it( 'should bind root#isReadOnly to controller#isReadOnly', () => {
-			const domRoot = createElement( document, 'div', null, createElement( document, 'p' ) );
-			const viewRoot = editing.createRoot( domRoot );
-
-			editing.isReadOnly = false;
-
-			expect( viewRoot.isReadOnly ).to.false;
-
-			editing.isReadOnly = true;
-
-			expect( viewRoot.isReadOnly ).to.true;
-		} );
 	} );
 
 	describe( 'conversion', () => {