This commit is contained in:
yumoqing 2024-05-11 17:01:51 +08:00
parent 935b1da0d0
commit adfa214047

View File

@ -344,19 +344,19 @@ bricks.buildScriptHandler = function(w, target, rtdata, desc){
bricks.extend(params, rtdata);
params = bricks.apply_data(params, rtdata);
var AsyncFunction = Object.getPrototypeOf(async function(){}).constructor;
var f = new AsyncFunction('target', 'params', 'event', desc.script);
return f.bind(target, target, params);
var f = new AsyncFunction('params', 'event', desc.script);
return f.bind(target, params);
}
bricks.buildDispatchEventHandler = function(w, target, rtdata, desc){
var f = function(target, event_name, params, event){
console.log('target=', target, 'event_name=', event_name, 'params=', params, 'Arguments=', arguments);
target.dispatch(event_name, params);
var f = function(event_name, params, event){
// console.log('target=', target, 'event_name=', event_name, 'params=', params, 'Arguments=', arguments);
this.dispatch(event_name, params);
}
var params = {};
bricks.extend(params, desc.params)
bricks.extend(params, rtdata);
params = bricks.apply_data(params, rtdata);
return f.bind(target, target, desc.dispatch_event, params);
return f.bind(target, desc.dispatch_event, params);
}
bricks.getWidgetById = function(id, from_widget){