Ensures notifications are shown for drag/drop uploads

This commit is contained in:
Shannon
2015-07-30 11:35:00 +02:00
parent 959378c456
commit bb94fc7d71
6 changed files with 62 additions and 39 deletions

View File

@@ -64,6 +64,13 @@ function umbImageFolder($rootScope, assetsService, $timeout, $log, umbRequestHel
found.completed = true;
}
//Show notifications!!!!
if (data.result && data.result.notifications && angular.isArray(data.result.notifications)) {
for (var n = 0; n < data.result.notifications.length; n++) {
notificationsService.showNotification(data.result.notifications[n]);
}
}
//when none are left resync everything
var remaining = _.filter(scope.files, function (file) { return file.completed !== true; });
if (remaining.length === 0) {

View File

@@ -1,7 +1,7 @@
//used for the media picker dialog
angular.module("umbraco")
.controller("Umbraco.Dialogs.MediaPickerController",
function ($scope, mediaResource, umbRequestHelper, entityResource, $log, mediaHelper, eventsService, treeService, $cookies, $element, $timeout) {
function ($scope, mediaResource, umbRequestHelper, entityResource, $log, mediaHelper, eventsService, treeService, $cookies, $element, $timeout, notificationsService) {
var dialogOptions = $scope.dialogOptions;
@@ -98,6 +98,12 @@ angular.module("umbraco")
$scope.gotoFolder($scope.currentFolder);
});
}
//Show notifications!!!!
if (data.result && data.result.notifications && angular.isArray(data.result.notifications)) {
for (var n = 0; n < data.result.notifications.length; n++) {
notificationsService.showNotification(data.result.notifications[n]);
}
}
});
// All these sit-ups are to add dropzone area and make sure it gets removed if dragging is aborted!