From ef502a8460b73218bc4145e1bbd9810feb173b58 Mon Sep 17 00:00:00 2001 From: bordun Date: Thu, 1 Nov 2018 13:24:11 +0100 Subject: [PATCH] switch: fix icons in labels (#413) --- CHANGELOG.md | 7 ++++++- src/client/app/widgets/buttons/switch.js | 5 +++-- src/scss/widgets/switch.scss | 8 ++------ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a6a354e..f44eb21c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 0.39.1 + +- bug fixes + - regressions breaking icons in switches' labels + ## 0.39.0 - performance @@ -7,7 +12,7 @@ - widgets - remove support for deprecated properties `path`, `noPip` and `noSync` - sliders/pads: `precision` is no longer a dynamic property - + ## 0.38.7 - bug fixes diff --git a/src/client/app/widgets/buttons/switch.js b/src/client/app/widgets/buttons/switch.js index cf085eea..80bf6af3 100644 --- a/src/client/app/widgets/buttons/switch.js +++ b/src/client/app/widgets/buttons/switch.js @@ -1,6 +1,7 @@ var Widget = require('../common/widget'), {iconify} = require('../../ui/utils'), - html = require('nanohtml') + html = require('nanohtml'), + raw = require('nanohtml/raw') module.exports = class Switch extends Widget { @@ -53,7 +54,7 @@ module.exports = class Switch extends Widget { if (this.getProp('showValues') && !isArray) label = label + ': ' + (this.stringValues[this.stringValues.length - 1] || values[k]) this.widget.appendChild(html` -
${iconify(label)}
+
${raw(iconify(label))}
`) } diff --git a/src/scss/widgets/switch.scss b/src/scss/widgets/switch.scss index bcecd817..21f5ee3b 100644 --- a/src/scss/widgets/switch.scss +++ b/src/scss/widgets/switch.scss @@ -24,13 +24,8 @@ &.horizontal { flex-direction:row; .value { - text-align: center; - display: flex; - justify-content: center; - flex-direction: column; border-top:0; border-right:1rem solid var(--color-bg); - flex: 1 1 100%; height:auto; margin-bottom:0; &:last-child { @@ -53,7 +48,8 @@ word-break: break-all; overflow: hidden; display: flex; - flex-direction: column; + flex-direction: row; + align-items: center; justify-content: center; box-shadow: 0 0 0 1rem var(--color-light) inset, 0 1rem 0 0 var(--color-light) inset;