Fixes: U4-3714 Media tree doesn't get refreshed after upload
This commit is contained in:
@@ -59,7 +59,7 @@ angular.module("umbraco.directives")
|
|||||||
node.stateCssClass = (node.cssClasses || []).join(" ");
|
node.stateCssClass = (node.cssClasses || []).join(" ");
|
||||||
|
|
||||||
if (node.style) {
|
if (node.style) {
|
||||||
$(element).find("i").attr("style", node.style);
|
$(element).find("i:first").attr("style", node.style);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,16 +37,19 @@ angular.module("umbraco")
|
|||||||
mediaResource.getChildren(id)
|
mediaResource.getChildren(id)
|
||||||
.then(function(data) {
|
.then(function(data) {
|
||||||
$scope.images = data.items;
|
$scope.images = data.items;
|
||||||
|
|
||||||
var path = editorState.current.path;
|
|
||||||
navigationService.syncTree({ tree: "media", path: path, forceReload: true }).then(function (syncArgs) {
|
|
||||||
$log.log(syncArgs.node);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.$on('fileuploadstop', function(event, files){
|
$scope.$on('fileuploadstop', function(event, files){
|
||||||
$scope.loadChildren($scope.options.formData.currentFolder);
|
$scope.loadChildren($scope.options.formData.currentFolder);
|
||||||
|
|
||||||
|
//sync the tree - don't force reload since we're not updating this particular node (i.e. its name or anything),
|
||||||
|
// then we'll get the resulting tree node which we can then use to reload it's children.
|
||||||
|
var path = editorState.current.path;
|
||||||
|
navigationService.syncTree({ tree: "media", path: path, forceReload: false }).then(function (syncArgs) {
|
||||||
|
navigationService.reloadNode(syncArgs.node);
|
||||||
|
});
|
||||||
|
|
||||||
$scope.queue = [];
|
$scope.queue = [];
|
||||||
$scope.filesUploading = [];
|
$scope.filesUploading = [];
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user