8
0
Просмотр исходного кода

Use file.getUrl() to obtain url to a file.

Maciej Gołaszewski 7 лет назад
Родитель
Сommit
712128bc81

+ 2 - 2
packages/ckeditor5-ckfinder/src/ckfindercommand.js

@@ -75,13 +75,13 @@ export default class CKFinderCommand extends Command {
 				const images = files.filter( file => file.isImage() );
 				const images = files.filter( file => file.isImage() );
 
 
 				for ( const linkFile of links ) {
 				for ( const linkFile of links ) {
-					editor.execute( 'link', linkFile.get( 'url' ) );
+					editor.execute( 'link', linkFile.getUrl() );
 				}
 				}
 
 
 				const imagesUrls = [];
 				const imagesUrls = [];
 
 
 				for ( const image of images ) {
 				for ( const image of images ) {
-					const url = image.get( 'url' );
+					const url = image.getUrl();
 
 
 					imagesUrls.push( url ? url : finder.request( 'file:getProxyUrl', { file: image } ) );
 					imagesUrls.push( url ? url : finder.request( 'file:getProxyUrl', { file: image } ) );
 				}
 				}

+ 1 - 1
packages/ckeditor5-ckfinder/tests/ckfindercommand.js

@@ -325,7 +325,7 @@ describe( 'CKFinderCommand', () => {
 		function mockFinderFile( url = 'foo/bar.jpg', isImage = true ) {
 		function mockFinderFile( url = 'foo/bar.jpg', isImage = true ) {
 			return {
 			return {
 				isImage: () => isImage,
 				isImage: () => isImage,
-				get: () => url
+				getUrl: () => url
 			};
 			};
 		}
 		}