Browse Source

Used improved View model binder in classes which depend on View.

Aleksander Nowodzinski 9 years ago
parent
commit
d01f5c294b

+ 3 - 1
packages/ckeditor5-engine/src/editable/editableview.js

@@ -17,6 +17,8 @@ export default class EditableView extends View {
 	 */
 
 	setEditableElement( editableElement ) {
+		const bind = this.attributeBinder;
+
 		if ( this.editableElement ) {
 			throw new CKEditorError(
 				'editableview-cannot-override-editableelement: The editableElement cannot be overriden.'
@@ -36,7 +38,7 @@ export default class EditableView extends View {
 			},
 
 			attributes: {
-				contentEditable: this.bindToAttribute( 'isEditable' )
+				contentEditable: bind.to( 'isEditable' )
 			}
 		} );
 	}

+ 4 - 2
packages/ckeditor5-engine/tests/_utils/ui/editable/framed/framededitableview.js

@@ -11,6 +11,8 @@ export default class FramedEditableView extends EditableView {
 	constructor( model ) {
 		super( model );
 
+		const bind = this.attributeBinder;
+
 		// Here's the tricky part - we must return the promise from init()
 		// because iframe loading may be asynchronous. However, we can't start
 		// listening to 'load' in init(), because at this point the element is already in the DOM
@@ -28,8 +30,8 @@ export default class FramedEditableView extends EditableView {
 				// It seems that we need to allow scripts in order to be able to listen to events.
 				// TODO: Research that. Perhaps the src must be set?
 				sandbox: 'allow-same-origin allow-scripts',
-				width: this.bindToAttribute( 'width' ),
-				height: this.bindToAttribute( 'height' )
+				width: bind.to( 'width' ),
+				height: bind.to( 'height' )
 			},
 			on: {
 				load: 'loaded'