From 1cd79d81af821470de2123e1c6febe2980d98111 Mon Sep 17 00:00:00 2001 From: Jan Skovgaard <1932158+BatJan@users.noreply.github.com> Date: Thu, 23 Jul 2020 17:28:24 +0200 Subject: [PATCH] umb-confirmation directive: move trashcan into directive and address accessibility issues (#8198) --- .../components/umbconfirmaction.directive.js | 32 ++++++++++++------- .../less/components/umb-confirm-action.less | 5 +++ .../components/tags/umb-tags-editor.html | 5 ++- .../views/components/umb-confirm-action.html | 25 +++++++++------ .../views/components/umb-groups-builder.html | 8 ++--- .../src/views/propertyeditors/grid/grid.html | 8 ++--- .../listview/layouts.prevalues.html | 26 +++++++-------- .../multipletextbox/multipletextbox.html | 9 ++---- 8 files changed, 66 insertions(+), 52 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/umbconfirmaction.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/umbconfirmaction.directive.js index 1dcccda481c6..2f682205ad84 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/umbconfirmaction.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/umbconfirmaction.directive.js @@ -14,10 +14,10 @@ The prompt can be opened in four direction up, down, left or right.

- @@ -71,17 +71,23 @@ The prompt can be opened in four direction up, down, left or right.

function link(scope, el, attr, ctrl) { - scope.clickConfirm = function() { - if(scope.onConfirm) { - scope.onConfirm(); - } - }; + scope.clickButton = function (event) { + if(scope.onDelete) { + scope.onDelete({$event: event}); + } + } - scope.clickCancel = function() { - if(scope.onCancel) { - scope.onCancel(); - } - }; + scope.clickConfirm = function() { + if(scope.onConfirm) { + scope.onConfirm(); + } + }; + + scope.clickCancel = function() { + if(scope.onCancel) { + scope.onCancel(); + } + }; } @@ -91,6 +97,8 @@ The prompt can be opened in four direction up, down, left or right.

templateUrl: 'views/components/umb-confirm-action.html', scope: { direction: "@", + show: "<", + onDelete: "&?", onConfirm: "&", onCancel: "&" }, diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-confirm-action.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-confirm-action.less index f972633bf479..6ecfd520724b 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-confirm-action.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-confirm-action.less @@ -1,3 +1,8 @@ +//WRAPPER +.umb_confirm-action { + display: inline-block; +} + // OVERLAY .umb_confirm-action__overlay { position: absolute; diff --git a/src/Umbraco.Web.UI.Client/src/views/components/tags/umb-tags-editor.html b/src/Umbraco.Web.UI.Client/src/views/components/tags/umb-tags-editor.html index 2929fd229cc8..4bb5232c9e7f 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/tags/umb-tags-editor.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/tags/umb-tags-editor.html @@ -11,10 +11,9 @@ - - - diff --git a/src/Umbraco.Web.UI.Client/src/views/components/umb-confirm-action.html b/src/Umbraco.Web.UI.Client/src/views/components/umb-confirm-action.html index 1b88c9f988d8..ddc237cc34ca 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/umb-confirm-action.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/umb-confirm-action.html @@ -1,22 +1,29 @@ -
+
+ - - +
diff --git a/src/Umbraco.Web.UI.Client/src/views/components/umb-groups-builder.html b/src/Umbraco.Web.UI.Client/src/views/components/umb-groups-builder.html index c46981a6cb77..b1c15b114095 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/umb-groups-builder.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/umb-groups-builder.html @@ -101,10 +101,10 @@
- @@ -264,10 +264,10 @@
- diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/grid.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/grid.html index dd3ae63ec7fb..4e45a724bcbf 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/grid.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/grid.html @@ -95,10 +95,10 @@
- @@ -205,9 +205,9 @@
- - diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/layouts.prevalues.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/layouts.prevalues.html index d0348bb708fd..a77064078259 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/layouts.prevalues.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/layouts.prevalues.html @@ -30,20 +30,18 @@
-
- - -
- - - -
-
+
+ +
+ + +
+
diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/multipletextbox/multipletextbox.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/multipletextbox/multipletextbox.html index baee2869242a..461d7a42a15e 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/multipletextbox/multipletextbox.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/multipletextbox/multipletextbox.html @@ -10,15 +10,12 @@
- +
- -