8
0
panr 5 лет назад
Родитель
Сommit
37e0764053

+ 3 - 3
packages/ckeditor5-image/src/imagetextalternative/imagetextalternativeui.js

@@ -117,7 +117,7 @@ export default class ImageTextAlternativeUI extends Plugin {
 
 
 		this.listenTo( this._form, 'submit', () => {
 		this.listenTo( this._form, 'submit', () => {
 			editor.execute( 'imageTextAlternative', {
 			editor.execute( 'imageTextAlternative', {
-				newValue: this._form.labeledInput.field.element.value
+				newValue: this._form.labeledInput.fieldView.element.value
 			} );
 			} );
 
 
 			this._hideForm( true );
 			this._hideForm( true );
@@ -177,9 +177,9 @@ export default class ImageTextAlternativeUI extends Plugin {
 		// stays unaltered) and re-opened it without changing the value of the command, they would see the
 		// stays unaltered) and re-opened it without changing the value of the command, they would see the
 		// old value instead of the actual value of the command.
 		// old value instead of the actual value of the command.
 		// https://github.com/ckeditor/ckeditor5-image/issues/114
 		// https://github.com/ckeditor/ckeditor5-image/issues/114
-		labeledInput.field.value = labeledInput.field.element.value = command.value || '';
+		labeledInput.fieldView.value = labeledInput.fieldView.element.value = command.value || '';
 
 
-		this._form.labeledInput.field.select();
+		this._form.labeledInput.fieldView.select();
 	}
 	}
 
 
 	/**
 	/**

+ 1 - 1
packages/ckeditor5-image/src/imagetextalternative/ui/textalternativeformview.js

@@ -189,7 +189,7 @@ export default class TextAlternativeFormView extends View {
 		const labeledInput = new LabeledFieldView( this.locale, createLabeledInputText );
 		const labeledInput = new LabeledFieldView( this.locale, createLabeledInputText );
 
 
 		labeledInput.label = t( 'Text alternative' );
 		labeledInput.label = t( 'Text alternative' );
-		labeledInput.field.placeholder = t( 'Text alternative' );
+		labeledInput.fieldView.placeholder = t( 'Text alternative' );
 
 
 		return labeledInput;
 		return labeledInput;
 	}
 	}

+ 8 - 8
packages/ckeditor5-image/tests/imagetextalternative/imagetextalternativeui.js

@@ -78,23 +78,23 @@ describe( 'ImageTextAlternativeUI', () => {
 		} );
 		} );
 
 
 		it( 'should set alt attribute value to textarea and select it', () => {
 		it( 'should set alt attribute value to textarea and select it', () => {
-			const spy = sinon.spy( form.labeledInput.field, 'select' );
+			const spy = sinon.spy( form.labeledInput.fieldView, 'select' );
 
 
 			setData( model, '[<image src="" alt="foo bar"></image>]' );
 			setData( model, '[<image src="" alt="foo bar"></image>]' );
 
 
 			button.fire( 'execute' );
 			button.fire( 'execute' );
 			sinon.assert.calledOnce( spy );
 			sinon.assert.calledOnce( spy );
-			expect( form.labeledInput.field.value ).equals( 'foo bar' );
+			expect( form.labeledInput.fieldView.value ).equals( 'foo bar' );
 		} );
 		} );
 
 
 		it( 'should set empty text to textarea and select it when there is no alt attribute', () => {
 		it( 'should set empty text to textarea and select it when there is no alt attribute', () => {
-			const spy = sinon.spy( form.labeledInput.field, 'select' );
+			const spy = sinon.spy( form.labeledInput.fieldView, 'select' );
 
 
 			setData( model, '[<image src=""></image>]' );
 			setData( model, '[<image src=""></image>]' );
 
 
 			button.fire( 'execute' );
 			button.fire( 'execute' );
 			sinon.assert.calledOnce( spy );
 			sinon.assert.calledOnce( spy );
-			expect( form.labeledInput.field.value ).equals( '' );
+			expect( form.labeledInput.fieldView.value ).equals( '' );
 		} );
 		} );
 	} );
 	} );
 
 
@@ -103,17 +103,17 @@ describe( 'ImageTextAlternativeUI', () => {
 		it( 'should make sure the input always stays in sync with the value of the command', () => {
 		it( 'should make sure the input always stays in sync with the value of the command', () => {
 			const button = editor.ui.componentFactory.create( 'imageTextAlternative' );
 			const button = editor.ui.componentFactory.create( 'imageTextAlternative' );
 			// Mock the value of the input after some past editing.
 			// Mock the value of the input after some past editing.
-			form.labeledInput.field.value = 'foo';
+			form.labeledInput.fieldView.value = 'foo';
 
 
 			// Mock the user using the form, changing the value but clicking "Cancel".
 			// Mock the user using the form, changing the value but clicking "Cancel".
 			// so the command's value is not updated.
 			// so the command's value is not updated.
-			form.labeledInput.field.element.value = 'This value was canceled.';
+			form.labeledInput.fieldView.element.value = 'This value was canceled.';
 
 
 			// Mock the user editing the same image once again.
 			// Mock the user editing the same image once again.
 			setData( model, '[<image src="" alt="foo"></image>]' );
 			setData( model, '[<image src="" alt="foo"></image>]' );
 
 
 			button.fire( 'execute' );
 			button.fire( 'execute' );
-			expect( form.labeledInput.field.element.value ).to.equal( 'foo' );
+			expect( form.labeledInput.fieldView.element.value ).to.equal( 'foo' );
 		} );
 		} );
 
 
 		it( 'should execute command on submit', () => {
 		it( 'should execute command on submit', () => {
@@ -122,7 +122,7 @@ describe( 'ImageTextAlternativeUI', () => {
 
 
 			sinon.assert.calledOnce( spy );
 			sinon.assert.calledOnce( spy );
 			sinon.assert.calledWithExactly( spy, 'imageTextAlternative', {
 			sinon.assert.calledWithExactly( spy, 'imageTextAlternative', {
-				newValue: form.labeledInput.field.element.value
+				newValue: form.labeledInput.fieldView.element.value
 			} );
 			} );
 		} );
 		} );