Fixes: U4-3714 Media tree doesn't get refreshed after upload

This commit is contained in:
Shannon
2013-12-10 15:10:11 +11:00
parent f41b0ff4b5
commit 7894fcfc91
2 changed files with 9 additions and 6 deletions

View File

@@ -59,7 +59,7 @@ angular.module("umbraco.directives")
node.stateCssClass = (node.cssClasses || []).join(" ");
if (node.style) {
$(element).find("i").attr("style", node.style);
$(element).find("i:first").attr("style", node.style);
}
}

View File

@@ -37,16 +37,19 @@ angular.module("umbraco")
mediaResource.getChildren(id)
.then(function(data) {
$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.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.filesUploading = [];
});