Kaynağa Gözat

Change the insertImageViaUrl form label depending on whether the image is currently selected or not.

panr 5 yıl önce
ebeveyn
işleme
e3907cf4fe

+ 3 - 0
packages/ckeditor5-image/src/imageupload/imageuploadui.js

@@ -64,6 +64,7 @@ export default class ImageUploadUI extends Plugin {
 		const editor = this.editor;
 		const t = editor.t;
 		const insertButtonView = imageUploadView.insertButtonView;
+		const insertImageViaUrlForm = imageUploadView.getIntegration( 'insertImageViaUrl' );
 
 		dropdownView.bind( 'isEnabled' ).to( command );
 
@@ -76,9 +77,11 @@ export default class ImageUploadUI extends Plugin {
 				if ( isImage( selectedElement ) ) {
 					imageUploadView.imageURLInputValue = selectedElement.getAttribute( 'src' );
 					insertButtonView.label = t( 'Update' );
+					insertImageViaUrlForm.label = t( 'Update image URL' );
 				} else {
 					imageUploadView.imageURLInputValue = '';
 					insertButtonView.label = t( 'Insert' );
+					insertImageViaUrlForm.label = t( 'Insert image via URL' );
 				}
 			}
 		} );