From 413defbfa8cdc0eda60382dbde70fc5185f4f5f0 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 28 Sep 2016 20:51:51 +0200 Subject: [PATCH] knob: added pips, disabled by default --- app/browser/js/app/widgets/sliders/knob.js | 10 +++++++++- app/browser/scss/widgets/_knob.scss | 14 ++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/app/browser/js/app/widgets/sliders/knob.js b/app/browser/js/app/widgets/sliders/knob.js index e0ee559c..111b3180 100644 --- a/app/browser/js/app/widgets/sliders/knob.js +++ b/app/browser/js/app/widgets/sliders/knob.js @@ -16,7 +16,7 @@ module.exports.options = { width:'auto', height:'auto', color:'auto', - noPip:false, + noPip:true, compact:false, angle:270, css:'', @@ -51,6 +51,14 @@ Knob = function(widgetData) { this.margin = 0 } + if (!widgetData.noPip) { + this.wrapper.append(` +
+
${this.rangeLabels[0]}
${this.rangeLabels[this.rangeLabels.length-1]}
+
+ `) + } + this.lastOffsetX = 0 this.lastOffsetY = 0 this.minDimension = 0 diff --git a/app/browser/scss/widgets/_knob.scss b/app/browser/scss/widgets/_knob.scss index 5d0c791c..44e96562 100644 --- a/app/browser/scss/widgets/_knob.scss +++ b/app/browser/scss/widgets/_knob.scss @@ -39,4 +39,18 @@ pointer-events: none; } } + .pips { + position: absolute; + bottom: 0; + left: 0; + right: 0; + display: flex; + justify-content: space-between; + pointer-events: none; + div { + padding: 0 8%; + font-size: 11rem; + color: var(--color-text-fade); + } + } }