don't compute widget's size init, since the resize event will do that when needed
This commit is contained in:
parent
28e6f177a2
commit
38c7908da7
5 changed files with 18 additions and 18 deletions
|
|
@ -57,8 +57,8 @@ module.exports.create = function(widgetData,container) {
|
|||
if (widgetData.horizontal) container.addClass('horizontal')
|
||||
|
||||
handle.size = 0
|
||||
fader.size = dimension=='height'?fader.outerHeight():fader.outerWidth()
|
||||
wrapper.size = dimension=='height'?wrapper.outerHeight():wrapper.outerWidth()
|
||||
fader.size = 0
|
||||
wrapper.size = 0
|
||||
|
||||
|
||||
var range = {}
|
||||
|
|
@ -72,16 +72,16 @@ module.exports.create = function(widgetData,container) {
|
|||
}
|
||||
}
|
||||
|
||||
var scale = []
|
||||
for (var i=0;i<=100;i++) {scale.push(i)}
|
||||
for (i in scale) {
|
||||
var pip = $('<div class="pip"></div>')
|
||||
if (range[i]!=undefined) {
|
||||
var piptext = Math.abs(range[i])>=1000?range[i]/1000+'k':range[i]
|
||||
pip.addClass('val').append('<span>'+piptext+'</span>')
|
||||
}
|
||||
pips.append(pip)
|
||||
var pipsInner = ''
|
||||
for (var i=0;i<=100;i++) {
|
||||
|
||||
var piptext = range[i]!=undefined?`<span>${Math.abs(range[i])>=1000?range[i]/1000+'k':range[i]}</span>`:''
|
||||
pipsInner += `
|
||||
<div class="pip ${range[i]!=undefined?'val':''}">${piptext}</div>
|
||||
`
|
||||
}
|
||||
pips.append(pipsInner)
|
||||
|
||||
if (dimension=='height') {
|
||||
pips.append(pips.find('.pip').get().reverse())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ module.exports.create = function(widgetData,container) {
|
|||
widget.find('.pip.min').text(pipmin)
|
||||
widget.find('.pip.max').text(pipmax)
|
||||
|
||||
mask.size = Math.floor(wrapper[0].offsetWidth*.58)
|
||||
mask.size = 0
|
||||
|
||||
wrapper.resize(function(){
|
||||
var w = Math.floor(wrapper[0].offsetWidth*.58)
|
||||
|
|
|
|||
|
|
@ -62,8 +62,8 @@ module.exports.create = function(widgetData,container) {
|
|||
if (widgetData.height!='auto') widget.addClass('manual-height')
|
||||
|
||||
|
||||
pad.width = pad.innerWidth()
|
||||
pad.height = pad.innerHeight()
|
||||
pad.width = 0
|
||||
pad.height = 0
|
||||
rgbHandle.height = 0
|
||||
rgbHandle.width = 0
|
||||
hueHandle.width = 0
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@ module.exports.create = function(widgetData,container) {
|
|||
canvas = widget.find('canvas'),
|
||||
ctx = canvas[0].getContext('2d')
|
||||
|
||||
widget.height = undefined
|
||||
widget.width = undefined
|
||||
widget.height = 0
|
||||
widget.width = 0
|
||||
widget.visible = false
|
||||
widget.lineColor = String(getComputedStyle(document.documentElement).getPropertyValue("--color-accent")).trim()
|
||||
widget.textColor = String(getComputedStyle(document.documentElement).getPropertyValue("--color-text-fade")).trim()
|
||||
|
|
|
|||
|
|
@ -57,8 +57,8 @@ module.exports.create = function(widgetData,container) {
|
|||
|
||||
if (widgetData.height!='auto') widget.addClass('manual-height')
|
||||
|
||||
pad.width = pad.innerWidth()
|
||||
pad.height = pad.innerHeight()
|
||||
pad.width = 0
|
||||
pad.height = 0
|
||||
handle.height = 0
|
||||
handle.width = 0
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue