Visual distinction between push and toggles & Knob style fix

Knob height is calculated on resize to ensure it gets EXACTLY centered when rotated (using only height + padding-bottom lead to a tiny miscentering of the rotating elements)
This commit is contained in:
jean-emmanuel 2016-02-29 17:42:04 +01:00
parent 3ab01737a2
commit 2b316cc254
3 changed files with 25 additions and 7 deletions

View file

@ -64,6 +64,15 @@ module.exports.create = function(widgetData,container) {
widget.find('.pip.min').text(pipmin)
widget.find('.pip.max').text(pipmax)
mask.size = mask[0].offsetWidth
mask.resize(function(){
var w = mask[0].offsetWidth
if (!w || mask.size==w) return
mask.size=w
mask[0].setAttribute('style',`height:${w}px;padding-bottom:0`)
})
knob.rotation = 0