U4-11412 only show cancel and confirm button when a handler is attached

This commit is contained in:
Dave Woestenborghs
2018-06-04 08:52:48 +02:00
parent 697cc7a420
commit 03019e9676
2 changed files with 11 additions and 2 deletions

View File

@@ -18,7 +18,16 @@ function confirmDirective() {
caption: '@'
},
link: function (scope, element, attr, ctrl) {
scope.showCancel = false;
scope.showConfirm = false;
if (scope.onConfirm) {
scope.showConfirm = true;
}
if (scope.onCancel) {
scope.showCancel = true;
}
}
};
}

View File

@@ -3,8 +3,8 @@
<div class="umb-pane btn-toolbar umb-btn-toolbar">
<div class="control-group umb-control-group">
<a ng-if="onCancel" href class="btn btn-link" ng-click="onCancel()"><localize key="general_cancel">Cancel</localize></a>
<a href class="btn btn-primary" ng-click="onConfirm()"><localize key="general_ok">Ok</localize></a>
<a ng-if="showCancel" href class="btn btn-link" ng-click="onCancel()"><localize key="general_cancel">Cancel</localize></a>
<a ng-if="showConfirm" href class="btn btn-primary" ng-click="onConfirm()"><localize key="general_ok">Ok</localize></a>
</div>
</div>
</div>