script: add updateProp() to force prop check on a widget
This commit is contained in:
parent
fab0ed0eab
commit
0e5edb76de
2 changed files with 24 additions and 1 deletions
|
|
@ -132,6 +132,21 @@ class ScriptVm extends Vm {
|
|||
|
||||
}
|
||||
|
||||
this.sandbox.contentWindow.updateProp = (id, prop)=>{
|
||||
|
||||
var widgets = this.resolveId(id),
|
||||
widget = this.getWidget()
|
||||
|
||||
if (widget.builtIn) widget = widget.parent
|
||||
|
||||
for (var i = widgets.length - 1; i >= 0; i--) {
|
||||
|
||||
widgets[i].updateProps(Array.isArray(prop) ? prop : [prop], widget)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
this.sandbox.contentWindow.httpGet = (url, callback)=>{
|
||||
|
||||
var parser = urlParser(url),
|
||||
|
|
@ -263,7 +278,7 @@ class ScriptVm extends Vm {
|
|||
|
||||
}
|
||||
|
||||
for (var imports of ['set', 'get', 'getProp', 'send', 'httpGet', 'stateGet', 'stateSet', 'storage',
|
||||
for (var imports of ['set', 'get', 'getProp', 'updateProp', 'send', 'httpGet', 'stateGet', 'stateSet', 'storage',
|
||||
'setInterval', 'clearInterval', 'setTimeout', 'clearTimeout']) {
|
||||
this.sanitize(this.sandbox.contentWindow[imports])
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue