add support for one custom media type

This commit is contained in:
Mads Rasmussen
2016-11-10 12:00:07 +01:00
parent 07c2a14321
commit f9d8754d88

View File

@@ -104,10 +104,16 @@ angular.module("umbraco.directives")
scope.queue = [];
}
// One allowed mediaType
if(scope.acceptedMediatypes && scope.acceptedMediatypes.length === 1){
// set alias to auto to let the server best decide which media type to use
scope.contentTypeAlias = "umbracoAuto";
// One allowed type
if(scope.acceptedMediatypes && scope.acceptedMediatypes.length === 1) {
// Standard setup - set alias to auto select to let the server best decide which media type to use
if(scope.acceptedMediatypes[0].alias === 'Image') {
scope.contentTypeAlias = "umbracoAutoSelect";
} else {
scope.contentTypeAlias = scope.acceptedMediatypes[0].alias;
}
_processQueueItem();
}