From 03019e9676a2277b61c3f9a18b3d0063a6bf7ca8 Mon Sep 17 00:00:00 2001 From: Dave Woestenborghs Date: Mon, 4 Jun 2018 08:52:48 +0200 Subject: [PATCH] U4-11412 only show cancel and confirm button when a handler is attached --- .../common/directives/components/umbconfirm.directive.js | 9 +++++++++ .../src/views/components/umb-confirm.html | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/umbconfirm.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/umbconfirm.directive.js index 0c618d9de3..11feb4e790 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/umbconfirm.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/umbconfirm.directive.js @@ -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; + } } }; } diff --git a/src/Umbraco.Web.UI.Client/src/views/components/umb-confirm.html b/src/Umbraco.Web.UI.Client/src/views/components/umb-confirm.html index 13920b3af9..5eb55144b2 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/umb-confirm.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/umb-confirm.html @@ -3,8 +3,8 @@
- Cancel - Ok + Cancel + Ok