Fixes: U4-4051 Bug when querying for root node with the remembered node id

This commit is contained in:
Mads Rasmussen
2015-12-03 11:45:59 +01:00
parent dbc519a9cf
commit 62e4bebab6

View File

@@ -179,7 +179,7 @@ angular.module("umbraco")
//default root item
if (!$scope.target) {
if($scope.lastOpenedNode) {
if($scope.lastOpenedNode && $scope.lastOpenedNode !== -1) {
entityResource.getById($scope.lastOpenedNode, "media")
.then(function(node){
@@ -187,13 +187,15 @@ angular.module("umbraco")
// make sure that las opened node is on the same path as start node
var nodePath = node.path.split(",");
if(nodePath.indexOf($scope.startNodeId) !== -1) {
if(nodePath.indexOf($scope.startNodeId.toString()) !== -1) {
$scope.gotoFolder({id: $scope.lastOpenedNode, name: "Media", icon: "icon-folder"});
} else {
$scope.gotoFolder({id: $scope.startNodeId, name: "Media", icon: "icon-folder"});
}
});
}, function (err) {
$scope.gotoFolder({id: $scope.startNodeId, name: "Media", icon: "icon-folder"});
});
} else {