From e22c7ea0d635adff0f221e957aacc9de31dc4bd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Mon, 17 Oct 2022 12:47:18 +0200 Subject: [PATCH] Merge BjarneF fix into 10.3 (#13220) Co-authored-by: Bjarne Fyrstenborg --- .../components/blockcard/umb-block-card.less | 7 +++- .../umb-property-info-button.less | 8 +++- .../blockgrid/umbblockgridentry.component.js | 20 ++++++--- ...blocklist.blockconfiguration.controller.js | 2 +- .../blocklist.blockconfiguration.html | 6 ++- .../blocklist.blockconfiguration.overlay.html | 42 +++++++++++-------- 6 files changed, 55 insertions(+), 30 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/components/blockcard/umb-block-card.less b/src/Umbraco.Web.UI.Client/src/views/components/blockcard/umb-block-card.less index 45cba81a0b..fee768235a 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/blockcard/umb-block-card.less +++ b/src/Umbraco.Web.UI.Client/src/views/components/blockcard/umb-block-card.less @@ -130,13 +130,18 @@ umb-block-card { right: 10px; opacity: 0; transition: opacity 120ms; + margin-right: 10px; + .__action { - display: inline-block; + display: inline-flex; + justify-content: center; + align-items: center; border-radius: 50%; width: 28px; height: 28px; background-color: white; color:@ui-action-type; + &:hover { color: @ui-action-type-hover; } diff --git a/src/Umbraco.Web.UI.Client/src/views/components/umb-property-info-button/umb-property-info-button.less b/src/Umbraco.Web.UI.Client/src/views/components/umb-property-info-button/umb-property-info-button.less index 33e1156648..a892f1ca38 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/umb-property-info-button/umb-property-info-button.less +++ b/src/Umbraco.Web.UI.Client/src/views/components/umb-property-info-button/umb-property-info-button.less @@ -3,16 +3,20 @@ umb-property-info-button { display: inline-block; vertical-align: text-bottom; + .control-label + & { + margin-left: 3px; + } + > .__button { position: relative; display: inline-flex; align-items: center; justify-content: center; + text-align: center; width: 15px; height: 15px; - padding-top: 1px; - padding-left: 1px; + padding: 2px 1px 1px 1px; margin-top: -1px; font-size: 12px; font-weight: 700; diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/umbblockgridentry.component.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/umbblockgridentry.component.js index 22739d748c..a7c45ecdd8 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/umbblockgridentry.component.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blockgrid/umbblockgridentry.component.js @@ -311,7 +311,8 @@ vm.scaleHandlerKeyUp = function($event) { - let addCol = 0; + + let addColIndex = 0; let addRow = 0; switch ($event.originalEvent.key) { @@ -322,16 +323,23 @@ addRow = 1; break; case 'ArrowLeft': - addCol = -1; + addColIndex = -1; break; case 'ArrowRight': - addCol = 1; + addColIndex = 1; break; } - const newColumnSpan = Math.max(vm.layoutEntry.columnSpan + addCol, 1); - - vm.layoutEntry.columnSpan = closestColumnSpanOption(newColumnSpan, vm.layoutEntry.$block.config.columnSpanOptions, gridColumns.length).columnSpan; + if(addColIndex !== 0) { + if (vm.layoutEntry.$block.config.columnSpanOptions.length > 0) { + const sortOptions = vm.layoutEntry.$block.config.columnSpanOptions.sort((a,b) => (a.columnSpan > b.columnSpan) ? 1 : ((b.columnSpan > a.columnSpan) ? -1 : 0)); + const currentColIndex = sortOptions.findIndex(x => x.columnSpan === vm.layoutEntry.columnSpan); + const newColIndex = Math.min(Math.max(currentColIndex + addColIndex, 0), sortOptions.length-1); + vm.layoutEntry.columnSpan = sortOptions[newColIndex].columnSpan; + } else { + vm.layoutEntry.columnSpan = vm.layoutColumnsInt; + } + } let newRowSpan = Math.max(vm.layoutEntry.rowSpan + addRow, vm.layoutEntry.$block.config.rowMinSpan || 1); if(vm.layoutEntry.$block.config.rowMaxSpan != null) { newRowSpan = Math.min(newRowSpan, vm.layoutEntry.$block.config.rowMaxSpan); diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/prevalue/blocklist.blockconfiguration.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/prevalue/blocklist.blockconfiguration.controller.js index f0b89a095f..91b1f88444 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/prevalue/blocklist.blockconfiguration.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/prevalue/blocklist.blockconfiguration.controller.js @@ -72,7 +72,7 @@ }); event.stopPropagation(); - } + }; vm.removeBlockByIndex = function (index) { $scope.model.value.splice(index, 1); diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/prevalue/blocklist.blockconfiguration.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/prevalue/blocklist.blockconfiguration.html index 3172219434..cdefd12993 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/prevalue/blocklist.blockconfiguration.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/prevalue/blocklist.blockconfiguration.html @@ -8,8 +8,10 @@ ng-repeat="block in model.value" ng-class="{'--isOpen':vm.openBlock === block}" ng-click="vm.openBlockOverlay(block)"> -
- diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/prevalue/blocklist.blockconfiguration.overlay.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/prevalue/blocklist.blockconfiguration.overlay.html index cc324f70d5..58ca11b716 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/prevalue/blocklist.blockconfiguration.overlay.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/prevalue/blocklist.blockconfiguration.overlay.html @@ -26,9 +26,9 @@
- +
- +
@@ -36,7 +36,7 @@
- + Overwrite how this block appears in the BackOffice UI. Pick a .html file containing your presentation. @@ -50,7 +50,7 @@
-
@@ -60,7 +60,7 @@
- +
@@ -71,7 +71,7 @@
-
@@ -81,9 +81,9 @@
- +
- @@ -107,12 +107,12 @@
- +
-
@@ -124,7 +124,7 @@
- +
@@ -137,7 +137,7 @@
-
@@ -157,9 +157,10 @@
- +
@@ -171,9 +172,10 @@
- +
@@ -185,7 +187,7 @@
- +
@@ -196,7 +198,7 @@
-
@@ -218,9 +220,13 @@
- +
- + +