From 21154d908e73e9f2e19a8d2f7de9c3f7f5128fdb Mon Sep 17 00:00:00 2001 From: Lone Iversen <108085781+loivsen@users.noreply.github.com> Date: Tue, 23 Aug 2022 16:00:11 +0200 Subject: [PATCH] preselect with if statements --- .../components/icon-selector.element.ts | 66 +++++++++---------- 1 file changed, 31 insertions(+), 35 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/components/icon-selector.element.ts b/src/Umbraco.Web.UI.Client/src/backoffice/components/icon-selector.element.ts index da60e3ac90..93d0b97bfa 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/components/icon-selector.element.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/components/icon-selector.element.ts @@ -12,15 +12,11 @@ class UmbIconSelector extends UmbModalLayoutElement { css` :host { position: relative; - max-height: 100%; - height: 100vh; - box-sizing: border-box; - display: flex; - overflow-y: scroll; } #box { - margin: 10px 10px; + overflow-y: auto; + max-height: 100vh; } #box .header-icon { @@ -79,6 +75,9 @@ class UmbIconSelector extends UmbModalLayoutElement { line-height: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(40px, auto)); + overflow-y: scroll; + max-height: 100%; + min-height: 0; } #icon-selection .icon { @@ -100,8 +99,9 @@ class UmbIconSelector extends UmbModalLayoutElement { }*/ #icon-selection .icon:focus, - #icon-selection .icon:hover { - background-color: rgba(0, 0, 0, 0.05); + #icon-selection .icon:hover, + #icon-selection .icon.selected { + background-color: rgba(0, 0, 0, 0.1); } `, ]; @@ -487,12 +487,16 @@ class UmbIconSelector extends UmbModalLayoutElement { slot="headline" .name="${this._currentIcon}" .style="${this._setColor(this._currentColor)}"> + ${this.renderSearchbar()}
+
${this.renderPalette()}
+
${this.renderIconSelection()}
+ Close Save @@ -510,32 +514,24 @@ class UmbIconSelector extends UmbModalLayoutElement { } renderPalette() { - return html`${this.colorlist.map((color, index) => { - if (index === 0) { - return html``; - } else { - return html``; - } + return html`${this.colorlist.map((color) => { + return html``; })}`; } @@ -545,7 +541,7 @@ class UmbIconSelector extends UmbModalLayoutElement {