Allow universal modules to have multiple listeners in inner

pull/1/head
yflory 4 years ago
parent 96892bff48
commit 08073f4853

@ -212,9 +212,8 @@ define([
var modules = {};
funcs.makeUniversal = function (type, cfg) {
if (cfg && cfg.onEvent) {
modules[type] = {
onEvent: cfg.onEvent || function () {}
};
modules[type] = modules[type] || Util.mkEvent();
modules[type].reg(cfg.onEvent);
}
var sframeChan = funcs.getSframeChannel();
return {
@ -833,7 +832,7 @@ define([
ctx.sframeChan.on('EV_UNIVERSAL_EVENT', function (obj) {
var type = obj.type;
if (!type || !modules[type]) { return; }
modules[type].onEvent(obj.data);
modules[type].fire(obj.data);
});
ctx.cache = Cache.create(ctx.sframeChan);

Loading…
Cancel
Save