Fix the flickering source name and the close button when moving items in the media tree.

This commit is contained in:
Kenn Jacobsen
2018-11-26 22:47:42 +01:00
committed by Sebastiaan Janssen
parent c00b3e283d
commit 8ff697ad98
2 changed files with 7 additions and 7 deletions

View File

@@ -3,7 +3,7 @@ angular.module("umbraco").controller("Umbraco.Editors.Media.MoveController",
function ($scope, userService, eventsService, mediaResource, appState, treeService, navigationService) {
$scope.dialogTreeApi = {};
var node = $scope.currentNode;
$scope.source = _.clone($scope.currentNode);
$scope.treeModel = {
hideHeader: false
@@ -13,8 +13,8 @@ angular.module("umbraco").controller("Umbraco.Editors.Media.MoveController",
});
function treeLoadedHandler(args) {
if (node && node.path) {
$scope.dialogTreeApi.syncTree({ path: node.path, activate: false });
if ($scope.source && $scope.source.path) {
$scope.dialogTreeApi.syncTree({ path: $scope.source.path, activate: false });
}
}
@@ -55,7 +55,7 @@ angular.module("umbraco").controller("Umbraco.Editors.Media.MoveController",
$scope.move = function () {
$scope.busy = true;
mediaResource.move({ parentId: $scope.target.id, id: node.id })
mediaResource.move({ parentId: $scope.target.id, id: $scope.source.id })
.then(function (path) {
$scope.busy = false;
$scope.error = false;

View File

@@ -11,14 +11,14 @@
<div ng-show="success">
<div class="alert alert-success">
<strong>{{currentNode.name}}</strong> was moved underneath <strong>{{target.name}}</strong>
<strong>{{source.name}}</strong> was moved underneath <strong>{{target.name}}</strong>
</div>
<button class="btn btn-primary" ng-click="nav.hideDialog()">Ok</button>
<button class="btn btn-primary" ng-click="close()">Ok</button>
</div>
<p class="abstract" ng-hide="success">
<localize key="actions_chooseWhereToMove">Choose where to move</localize>
<strong>{{currentNode.name}}</strong>
<strong>{{source.name}}</strong>
<localize key="actions_toInTheTreeStructureBelow">to in the tree structure below</localize>
</p>