Commit ef5ecb2f authored by JC Brand's avatar JC Brand

Decouple converse-controlbox and converse-profile

parent edcb8e28
......@@ -363,7 +363,7 @@ converse.plugins.add('converse-chatview', {
this.render();
this.updateAfterMessagesFetched();
/**
* Triggered once the _converse.ChatBoxView has been initialized
* Triggered once the {@link _converse.ChatBoxView} has been initialized
* @event _converse#chatBoxInitialized
* @type { _converse.ChatBoxView | _converse.HeadlinesBoxView }
* @example _converse.api.listen.on('chatBoxInitialized', view => { ... });
......
......@@ -8,7 +8,6 @@
* @module converse-controlbox
*/
import "converse-chatview";
import "converse-profile";
import _FormData from "formdata-polyfill";
import bootstrap from "bootstrap.native";
import converse from "@converse/headless/converse-core";
......@@ -476,16 +475,13 @@ converse.plugins.add('converse-controlbox', {
className: 'controlbox-pane',
initialize () {
if (!_converse.XMPPStatusView) {
return;
}
_converse.xmppstatusview = new _converse.XMPPStatusView({
'model': _converse.xmppstatus
});
this.el.insertAdjacentElement(
'afterBegin',
_converse.xmppstatusview.render().el
);
/**
* Triggered once the {@link _converse.ControlBoxPane} has been initialized
* @event _converse#controlBoxPaneInitialized
* @type { _converse.ControlBoxPane }
* @example _converse.api.listen.on('controlBoxPaneInitialized', view => { ... });
*/
_converse.api.trigger('controlBoxPaneInitialized', this);
}
});
......
......@@ -306,6 +306,14 @@ converse.plugins.add('converse-profile', {
}
}
});
/******************** Event Handlers ********************/
_converse.api.listen.on('controlBoxPaneInitialized', (view) => {
_converse.xmppstatusview = new _converse.XMPPStatusView({'model': _converse.xmppstatus});
view.el.insertAdjacentElement('afterBegin', _converse.xmppstatusview.render().el);
});
}
});
......@@ -17,6 +17,7 @@ import "converse-muc-views"; // Views related to MUC
import "converse-notification"; // HTML5 Notifications
import "converse-omemo";
import "converse-push"; // XEP-0357 Push Notifications
import "converse-profile";
import "converse-register"; // XEP-0077 In-band registration
import "converse-roomslist"; // Show currently open chat rooms
import "converse-rosterview";
......
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