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
|
|
@ -92,6 +92,7 @@ var updateDom = function(container,data) {
|
|||
|
||||
newContainer.find('[data-tab]:first-child').click()
|
||||
|
||||
$(window).resize()
|
||||
|
||||
purgeStores(purgetabs)
|
||||
|
||||
|
|
|
|||
|
|
@ -12,10 +12,24 @@ module.exports = function(session,callback) {
|
|||
|
||||
setTimeout(function(){
|
||||
parsetabs(session,$('#container'),true)
|
||||
|
||||
// var t = $('<div></div>').appendTo('body')
|
||||
// for (id in TABS) {
|
||||
// if (id!='#container') {
|
||||
// t[0].appendChild(TABS[id].tab[0])
|
||||
// }
|
||||
// }
|
||||
// setTimeout(function(){
|
||||
// t.detach()
|
||||
// },250)
|
||||
|
||||
|
||||
ui.init()
|
||||
editorDisable()
|
||||
editorInit()
|
||||
sync()
|
||||
|
||||
|
||||
setTimeout(function(){
|
||||
spinner.remove()
|
||||
if (!callback) return
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ var tabs = function() {
|
|||
if (!$(this).siblings('.on').length) $(this).click()
|
||||
})
|
||||
|
||||
$(window).resize()
|
||||
|
||||
})
|
||||
$('li[data-tab]').first().click()
|
||||
|
|
|
|||
|
|
@ -98,8 +98,10 @@ module.exports.create = function(widgetData,container) {
|
|||
mask.size = 0
|
||||
widget.value = undefined
|
||||
|
||||
wrapper.resize(function(){
|
||||
var w = Math.floor(wrapper[0].offsetWidth*.58)
|
||||
wrapper.resize(function(e,width,height){
|
||||
|
||||
var w = Math.floor(Math.min(height,width)*.58)
|
||||
|
||||
if (!w || mask.size==w) return
|
||||
mask.size=w
|
||||
mask[0].setAttribute('style',`height:${w}px;width:${w}px;padding-bottom:0`)
|
||||
|
|
|
|||
|
|
@ -82,7 +82,6 @@ module.exports.create = function(widgetData,container) {
|
|||
|
||||
if (!self.visible) {
|
||||
widget.visible = true
|
||||
canvas.addClass('visible')
|
||||
widget.lineColor = getComputedStyle(widget[0]).getPropertyValue('--color-accent')
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -58,7 +58,6 @@ module.exports.create = function(widgetData,container) {
|
|||
|
||||
if (!self.visible) {
|
||||
widget.visible = true
|
||||
canvas.addClass('visible')
|
||||
widget.lineColor = getComputedStyle(widget[0]).getPropertyValue('--color-accent')
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue