Skip to content

Commit

Permalink
Disable move/copy button until a target node is selected (umbraco#3250)
Browse files Browse the repository at this point in the history
  • Loading branch information
kjac authored and nul800sebastiaan committed Oct 23, 2018
1 parent 5f76596 commit f699768
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/Umbraco.Web.UI.Client/src/views/content/copy.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@
</div>

<div class="umb-dialog-footer btn-toolbar umb-btn-toolbar" ng-hide="success">
<a class="btn btn-link" ng-click="nav.hideDialog()" ng-if="!busy">
<a class="btn btn-link" ng-click="nav.hideDialog()" ng-show="!busy">
<localize key="general_cancel">Cancel</localize>
</a>
<button class="btn btn-primary" ng-click="copy()" ng-disabled="busy">
<button class="btn btn-primary" ng-click="copy()" ng-disabled="busy || !target">
<localize key="actions_copy">Copy</localize>
</button>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/Umbraco.Web.UI.Client/src/views/content/move.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@


<div class="umb-dialog-footer btn-toolbar umb-btn-toolbar" ng-hide="success">
<a class="btn btn-link" ng-click="nav.hideDialog()" ng-if="!busy">
<a class="btn btn-link" ng-click="nav.hideDialog()" ng-show="!busy">
<localize key="general_cancel">Cancel</localize>
</a>
<button class="btn btn-primary" ng-click="move()" ng-disabled="busy">
<button class="btn btn-primary" ng-click="move()" ng-disabled="busy || !target">
<localize key="actions_move">Move</localize>
</button>
</div>
</div>
</div>
4 changes: 2 additions & 2 deletions src/Umbraco.Web.UI.Client/src/views/datatypes/move.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
</div>

<div class="umb-dialog-footer btn-toolbar umb-btn-toolbar" ng-hide="success">
<a class="btn btn-link" ng-click="nav.hideDialog()" ng-if="!busy">
<a class="btn btn-link" ng-click="nav.hideDialog()" ng-show="!busy">
<localize key="general_cancel">Cancel</localize>
</a>
<button class="btn btn-primary" ng-click="move()" ng-disabled="busy">
<button class="btn btn-primary" ng-click="move()" ng-disabled="busy || !target">
<localize key="actions_move">Move</localize>
</button>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/Umbraco.Web.UI.Client/src/views/documenttypes/copy.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
</div>

<div class="umb-dialog-footer btn-toolbar umb-btn-toolbar" ng-hide="success">
<a class="btn btn-link" ng-click="nav.hideDialog()" ng-if="!busy">
<a class="btn btn-link" ng-click="nav.hideDialog()" ng-show="!busy">
<localize key="general_cancel">Cancel</localize>
</a>
<button class="btn btn-primary" ng-click="copy()" ng-disabled="busy">
<button class="btn btn-primary" ng-click="copy()" ng-disabled="busy || !target">
<localize key="actions_copy">Copy</localize>
</button>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/Umbraco.Web.UI.Client/src/views/documenttypes/move.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
</div>

<div class="umb-dialog-footer btn-toolbar umb-btn-toolbar" ng-hide="success">
<a class="btn btn-link" ng-click="nav.hideDialog()" ng-if="!busy">
<a class="btn btn-link" ng-click="nav.hideDialog()" ng-show="!busy">
<localize key="general_cancel">Cancel</localize>
</a>
<button class="btn btn-primary" ng-click="move()" ng-disabled="busy">
<button class="btn btn-primary" ng-click="move()" ng-disabled="busy || !target">
<localize key="actions_move">Move</localize>
</button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ angular.module("umbraco").controller("Umbraco.Editors.Media.MoveController",
$scope.dialogTreeEventHandler.bind("treeNodeExpanded", nodeExpandedHandler);

$scope.move = function () {
$scope.busy = true;
mediaResource.move({ parentId: $scope.target.id, id: node.id })
.then(function (path) {
$scope.busy = false;
$scope.error = false;
$scope.success = true;

Expand Down Expand Up @@ -97,4 +99,4 @@ angular.module("umbraco").controller("Umbraco.Editors.Media.MoveController",
$scope.miniListView = node;
}

});
});
4 changes: 2 additions & 2 deletions src/Umbraco.Web.UI.Client/src/views/media/move.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
</div>

<div class="umb-dialog-footer btn-toolbar umb-btn-toolbar" ng-hide="success">
<a class="btn btn-link" ng-click="nav.hideDialog()"><localize key="general_cancel">Cancel</localize></a>
<button class="btn btn-primary" ng-click="move()"><localize key="actions_move">Move</localize></button>
<a class="btn btn-link" ng-click="nav.hideDialog()" ng-show="!busy"><localize key="general_cancel">Cancel</localize></a>
<button class="btn btn-primary" ng-click="move()" ng-disabled="busy || !target"><localize key="actions_move">Move</localize></button>
</div>
</div>
4 changes: 2 additions & 2 deletions src/Umbraco.Web.UI.Client/src/views/mediatypes/copy.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
</div>

<div class="umb-dialog-footer btn-toolbar umb-btn-toolbar" ng-hide="success">
<a class="btn btn-link" ng-click="nav.hideDialog()" ng-if="!busy">
<a class="btn btn-link" ng-click="nav.hideDialog()" ng-show="!busy">
<localize key="general_cancel">Cancel</localize>
</a>
<button class="btn btn-primary" ng-click="copy()" ng-disabled="busy">
<button class="btn btn-primary" ng-click="copy()" ng-disabled="busy || !target">
<localize key="actions_copy">Copy</localize>
</button>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/Umbraco.Web.UI.Client/src/views/mediatypes/move.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
</div>

<div class="umb-dialog-footer btn-toolbar umb-btn-toolbar" ng-hide="success">
<a class="btn btn-link" ng-click="nav.hideDialog()" ng-if="!busy">
<a class="btn btn-link" ng-click="nav.hideDialog()" ng-show="!busy">
<localize key="general_cancel">Cancel</localize>
</a>
<button class="btn btn-primary" ng-click="move()" ng-disabled="busy">
<button class="btn btn-primary" ng-click="move()" ng-disabled="busy || !target">
<localize key="actions_move">Move</localize>
</button>
</div>
Expand Down

0 comments on commit f699768

Please sign in to comment.