From 08073f4853b73a356be2275de2987ce95150129f Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 30 Mar 2021 15:18:58 +0200 Subject: [PATCH] Allow universal modules to have multiple listeners in inner --- www/common/sframe-common.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/www/common/sframe-common.js b/www/common/sframe-common.js index 285498fcf..9ae09f571 100644 --- a/www/common/sframe-common.js +++ b/www/common/sframe-common.js @@ -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);