scripting: add scrollIntoView()

This commit is contained in:
jean-emmanuel 2026-04-23 10:14:03 +02:00
parent 22068ab47e
commit 7fc5372ca1
3 changed files with 26 additions and 6 deletions

View file

@ -279,6 +279,24 @@ class ScriptVm extends Vm {
}
this.globals.scrollIntoView = (id, options)=>{
this.checkContext('setScroll')
var widgets = this.resolveId(id)
for (var i = widgets.length - 1; i >= 0; i--) {
if (widgets[i].container && widgets[i].isVisible()) {
widgets[i].container.scrollIntoView(options)
}
}
}
this.globals.httpGet = (url, callback)=>{
this.checkContext('httpGet')