mobile: fix build for real

This commit is contained in:
jean-emmanuel 2024-10-05 17:50:58 +02:00
parent 8fb4662bd1
commit c945b8decf
3 changed files with 6 additions and 9 deletions

View file

@ -120,7 +120,7 @@ module.exports = {
editor.toggleGrid()
})
})
updateMobileThemeColor()
updateMobileThemeColor(root)
}
}

View file

@ -1,6 +1,5 @@
var chroma = require('chroma-js'),
fastdom = require('fastdom'),
widgetManager
fastdom = require('fastdom')
module.exports = {
@ -43,12 +42,10 @@ module.exports = {
},
updateMobileThemeColor: function(){
if (!widgetManager) widgetManager = require('../managers/widgets')
updateMobileThemeColor: function(root) {
fastdom.measure(()=>{
var root = widgetManager.getWidgetById('root')[0]
var style = window.getComputedStyle(root ? root.widget : document.documentElement)
fastdom.mutate(()=>{

View file

@ -86,7 +86,7 @@ class Root extends StaticProperties(Panel, {visible: true, label: false, id: 'ro
this.checkMenuVisibility()
return
case 'colorBg':
updateMobileThemeColor()
updateMobileThemeColor(this)
}
@ -104,7 +104,7 @@ class Root extends StaticProperties(Panel, {visible: true, label: false, id: 'ro
setCssVariables() {
super.setCssVariables()
updateMobileThemeColor()
updateMobileThemeColor(this)
}