button: safe script string search

This commit is contained in:
jean-emmanuel 2021-12-13 10:20:04 +01:00
parent 21bcea4f74
commit 0a1b30416f

View file

@ -64,7 +64,7 @@ class Button extends Widget {
this.pulse = null
this.buttonSize = [100, 100]
this.exposeTouchCoords = this.getProp('script').includes('touchCoords')
this.exposeTouchCoords = String(this.getProp('script')).includes('touchCoords')
this.parsersLocalScope.touchCoords = [0.5, 0.5]
if (this.exposeTouchCoords) {
this.on('resize', (e)=>{