diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/upload/umbpropertyfileupload.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/upload/umbpropertyfileupload.directive.js index b3094d9dab..83c2032e7d 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/upload/umbpropertyfileupload.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/upload/umbpropertyfileupload.directive.js @@ -22,7 +22,16 @@ vm.files = []; //notify the callback - vm.onValueChanged({ value: null }); + notifyValueChanged(null); + } + + function notifyValueChanged(val) { + + //notify the callback + vm.onValueChanged({ value: val }); + + //need to explicity setDirty here to track changes + vm.fileUploadForm.$setDirty(); } /** Called when the component initializes */ @@ -119,10 +128,7 @@ return null; } - var thumbnailUrl = umbRequestHelper.getApiUrl( - "imagesApiBaseUrl", - "GetBigThumbnail", - [{ originalImagePath: file.fileName }]) + '&rnd=' + Math.random(); + var thumbnailUrl = mediaHelper.getThumbnailFromPath(file.fileName); return thumbnailUrl; } @@ -186,12 +192,8 @@ }); var newVal = updateModelFromSelectedFiles(args.files); - - //need to explicity setDirty here to track changes - vm.fileUploadForm.$setDirty(); - //notify the callback - vm.onValueChanged({ value: newVal }); + notifyValueChanged(newVal); } angularHelper.safeApply($scope); diff --git a/src/Umbraco.Web.UI.Client/src/common/services/mediahelper.service.js b/src/Umbraco.Web.UI.Client/src/common/services/mediahelper.service.js index 636437e387..9cdd4eeb03 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/mediahelper.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/mediahelper.service.js @@ -307,11 +307,8 @@ function mediaHelper(umbRequestHelper) { var thumbnailUrl = umbRequestHelper.getApiUrl( "imagesApiBaseUrl", "GetBigThumbnail", - [{ originalImagePath: imagePath }]); - - //var ext = imagePath.substr(imagePath.lastIndexOf('.')); - //return imagePath.substr(0, imagePath.lastIndexOf('.')) + "_big-thumb" + ".jpg"; - + [{ originalImagePath: imagePath }]) + '&rnd=' + Math.random(); + return thumbnailUrl; }, diff --git a/src/Umbraco.Web.UI.Client/src/views/components/upload/umb-property-file-upload.html b/src/Umbraco.Web.UI.Client/src/views/components/upload/umb-property-file-upload.html index 6421525113..c22de15dae 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/upload/umb-property-file-upload.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/upload/umb-property-file-upload.html @@ -1,5 +1,6 @@