Commit ba9c3b01 authored by JC Brand's avatar JC Brand

Set `converse` on the window and trigger an event after loaded.

Setting it on `window` is necessary to have it available inside a
webcomponent.

Triggering an event is necessary so that we don't call
`converse.initialize` too early.
parent 03371c18
...@@ -2003,7 +2003,7 @@ ...@@ -2003,7 +2003,7 @@
}; };
// The public API // The public API
return { window.converse = {
'initialize' (settings, callback) { 'initialize' (settings, callback) {
return _converse.initialize(settings, callback); return _converse.initialize(settings, callback);
}, },
...@@ -2035,4 +2035,6 @@ ...@@ -2035,4 +2035,6 @@
'utils': utils 'utils': utils
} }
}; };
window.dispatchEvent(new Event('converse-loaded'));
return window.converse;
})); }));
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment