mirror of https://github.com/xwiki-labs/cryptpad
Allow universal modules to have multiple listeners in inner
This commit is contained in:
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…
Reference in New Issue