Procházet zdrojové kódy

Change #field to #fieldView

panr před 5 roky
rodič
revize
59ce65e0ee

+ 1 - 1
packages/ckeditor5-media-embed/src/mediaembedui.js

@@ -83,7 +83,7 @@ export default class MediaEmbedUI extends Plugin {
 			// didn't change the selection), they would see the old value instead of the actual value of the
 			// command.
 			form.url = command.value || '';
-			form.urlInputView.field.select();
+			form.urlInputView.fieldView.select();
 			form.focus();
 		}, { priority: 'low' } );
 

+ 3 - 3
packages/ckeditor5-media-embed/src/ui/mediaformview.js

@@ -213,7 +213,7 @@ export default class MediaFormView extends View {
 	 * @type {Number}
 	 */
 	get url() {
-		return this.urlInputView.field.element.value.trim();
+		return this.urlInputView.fieldView.element.value.trim();
 	}
 
 	/**
@@ -225,7 +225,7 @@ export default class MediaFormView extends View {
 	 * @param {String} url
 	 */
 	set url( url ) {
-		this.urlInputView.field.element.value = url.trim();
+		this.urlInputView.fieldView.element.value = url.trim();
 	}
 
 	/**
@@ -272,7 +272,7 @@ export default class MediaFormView extends View {
 		const t = this.locale.t;
 
 		const labeledInput = new LabeledFieldView( this.locale, createLabeledInputText );
-		const inputField = labeledInput.field;
+		const inputField = labeledInput.fieldView;
 
 		this._urlInputViewInfoDefault = t( 'Paste the media URL in the input.' );
 		this._urlInputViewInfoTip = t( 'Tip: Paste the URL into the content to embed faster.' );

+ 2 - 2
packages/ckeditor5-media-embed/tests/mediaembedui.js

@@ -84,7 +84,7 @@ describe( 'MediaEmbedUI', () => {
 			describe( '#open event', () => {
 				it( 'executes the actions with the "low" priority', () => {
 					const spy = sinon.spy();
-					const selectSpy = sinon.spy( form.urlInputView.field, 'select' );
+					const selectSpy = sinon.spy( form.urlInputView.fieldView, 'select' );
 
 					button.on( 'open', () => {
 						spy();
@@ -106,7 +106,7 @@ describe( 'MediaEmbedUI', () => {
 				} );
 
 				it( 'should select the content of the input', () => {
-					const spy = sinon.spy( form.urlInputView.field, 'select' );
+					const spy = sinon.spy( form.urlInputView.fieldView, 'select' );
 
 					button.fire( 'open' );
 					sinon.assert.calledOnce( spy );

+ 9 - 9
packages/ckeditor5-media-embed/tests/ui/mediaformview.js

@@ -79,7 +79,7 @@ describe( 'MediaFormView', () => {
 
 		describe( 'url input view', () => {
 			it( 'has placeholder', () => {
-				expect( view.urlInputView.field.placeholder ).to.equal( 'https://example.com' );
+				expect( view.urlInputView.fieldView.placeholder ).to.equal( 'https://example.com' );
 			} );
 
 			it( 'has info text', () => {
@@ -87,13 +87,13 @@ describe( 'MediaFormView', () => {
 			} );
 
 			it( 'displays the tip upon #input when the field has a value', () => {
-				view.urlInputView.field.element.value = 'foo';
-				view.urlInputView.field.fire( 'input' );
+				view.urlInputView.fieldView.element.value = 'foo';
+				view.urlInputView.fieldView.fire( 'input' );
 
 				expect( view.urlInputView.infoText ).to.match( /^Tip: Paste the URL into/ );
 
-				view.urlInputView.field.element.value = '';
-				view.urlInputView.field.fire( 'input' );
+				view.urlInputView.fieldView.element.value = '';
+				view.urlInputView.fieldView.fire( 'input' );
 
 				expect( view.urlInputView.infoText ).to.match( /^Paste the media URL/ );
 			} );
@@ -243,19 +243,19 @@ describe( 'MediaFormView', () => {
 
 	describe( 'url()', () => {
 		it( 'returns the #inputView DOM value', () => {
-			view.urlInputView.field.element.value = 'foo';
+			view.urlInputView.fieldView.element.value = 'foo';
 
 			expect( view.url ).to.equal( 'foo' );
 		} );
 
 		it( 'sets the #inputView DOM value', () => {
-			view.urlInputView.field.element.value = 'bar';
+			view.urlInputView.fieldView.element.value = 'bar';
 
 			view.url = 'foo';
-			expect( view.urlInputView.field.element.value ).to.equal( 'foo' );
+			expect( view.urlInputView.fieldView.element.value ).to.equal( 'foo' );
 
 			view.url = ' baz ';
-			expect( view.urlInputView.field.element.value ).to.equal( 'baz' );
+			expect( view.urlInputView.fieldView.element.value ).to.equal( 'baz' );
 		} );
 	} );