Skip to content

Commit

Permalink
Fix umbraco#7672 - Image can be added to root of Media when AllowAtRo…
Browse files Browse the repository at this point in the history
…ot is false (umbraco#7853)
  • Loading branch information
olibos authored Aug 31, 2020
1 parent 5bb61d1 commit 9c33f4b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//used for the media picker dialog
angular.module("umbraco")
.controller("Umbraco.Editors.MediaPickerController",
function ($scope, $timeout, mediaResource, entityResource, userService, mediaHelper, mediaTypeHelper, eventsService, treeService, localStorageService, localizationService, editorService, umbSessionStorage) {
function ($scope, $timeout, mediaResource, entityResource, userService, mediaHelper, mediaTypeHelper, eventsService, treeService, localStorageService, localizationService, editorService, umbSessionStorage, notificationsService) {

var vm = this;

Expand Down Expand Up @@ -166,8 +166,14 @@ angular.module("umbraco")
}
}

function upload() {
$(".umb-file-dropzone .file-select").trigger("click");
function upload(v) {
var fileSelect = $(".umb-file-dropzone .file-select");
if (fileSelect.length === 0){
localizationService.localize('media_uploadNotAllowed').then(function (message) { notificationsService.warning(message); });
}
else{
fileSelect.trigger("click");
}
}

function dragLeave() {
Expand Down Expand Up @@ -227,11 +233,7 @@ angular.module("umbraco")
$scope.path = [];
}

mediaTypeHelper.getAllowedImagetypes(folder.id)
.then(function (types) {
vm.acceptedMediatypes = types;
});

mediaTypeHelper.getAllowedImagetypes(folder.id).then(function (types) { vm.acceptedMediatypes = types; });
$scope.lockedFolder = (folder.id === -1 && $scope.model.startNodeIsVirtual) || hasFolderAccess(folder) === false;
$scope.currentFolder = folder;

Expand Down
1 change: 1 addition & 0 deletions src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@
<key alias="createFolderFailed">Failed to create a folder under parent id %0%</key>
<key alias="renameFolderFailed">Failed to rename the folder with id %0%</key>
<key alias="dragAndDropYourFilesIntoTheArea">Drag and drop your file(s) into the area</key>
<key alias="uploadNotAllowed">Upload is not allowed in this location.</key>
</area>
<area alias="member">
<key alias="createNewMember">Create a new member</key>
Expand Down

0 comments on commit 9c33f4b

Please sign in to comment.