switch: fix icons in labels (#413)

This commit is contained in:
bordun 2018-11-01 13:24:11 +01:00
parent eaaad0ff00
commit ef502a8460
3 changed files with 11 additions and 9 deletions

View file

@ -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

View file

@ -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`
<div class="value"> ${iconify(label)}</div>
<div class="value"> ${raw(iconify(label))}</div>
`)
}

View file

@ -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;