From 3eba3f636a6a061b425adbbd7376bcd50cf49a9d Mon Sep 17 00:00:00 2001 From: bordun Date: Thu, 6 May 2021 21:26:23 +0200 Subject: [PATCH] inspector: display dropdown and checkbox for boolean properties with extra choices --- CHANGELOG.md | 3 +++ src/client/ui/ui-inspector-field.js | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fa29aca..09b1956d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,9 @@ - button: add `soft` mode for the `wrap` property - switch: add `wrap` property +- editor + - display dropdown and checkbox for boolean properties with extra choices + ## 1.9.5 - bug fixes diff --git a/src/client/ui/ui-inspector-field.js b/src/client/ui/ui-inspector-field.js index 6eee0d97..b3f71970 100644 --- a/src/client/ui/ui-inspector-field.js +++ b/src/client/ui/ui-inspector-field.js @@ -88,7 +88,9 @@ class UiInspectorField extends UiWidget { this.container.appendChild(wrapper) - } else if (this.default.type.includes('boolean')) { + } + + if (this.default.type.includes('boolean')) { let toggle = html` @@ -98,7 +100,9 @@ class UiInspectorField extends UiWidget { this.container.appendChild(toggle) - } else if (this.name.includes('color')) { + } + + if (this.name.includes('color')) { let style = window.getComputedStyle(this.widget.container), colorData = this.widget.constructor.cssVariables.find(x=>x.js === this.name),