smarter knob sizing & compute widgets' sizes as soon as possible to avoid resize blinking
-> we do that by triggering the global resize event handler when loading a tab / editing a widget
This commit is contained in:
parent
b7bdaef70f
commit
f5d848321c
12 changed files with 49 additions and 39 deletions
|
|
@ -15,24 +15,17 @@ var startEvent = 'ontouchstart' in window ?'touchstart':'mousedown'
|
|||
self.width = undefined
|
||||
self.color = undefined
|
||||
self.center = settings.align == 'center'
|
||||
self.visible = false
|
||||
|
||||
|
||||
self.attr('tabindex',"0")
|
||||
|
||||
canvas.resize(function(e){
|
||||
canvas.resize(function(e,width,height){
|
||||
e.stopPropagation()
|
||||
|
||||
var width = canvas.width()*2,
|
||||
height = canvas.height()*2
|
||||
var width = width*2,
|
||||
height = height*2
|
||||
|
||||
if (height==100 && width==100) return
|
||||
|
||||
if (!self.visible) {
|
||||
self.visible = true
|
||||
canvas.addClass('visible')
|
||||
}
|
||||
|
||||
self.color = getComputedStyle(document.documentElement).getPropertyValue("--color-text")
|
||||
self.height=height
|
||||
self.width=width
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue