diff --git a/src/plugins/controlbox/index.js b/src/plugins/controlbox/index.js index 7df2b50b8..a466f8654 100644 --- a/src/plugins/controlbox/index.js +++ b/src/plugins/controlbox/index.js @@ -7,7 +7,6 @@ import "../../components/brand-heading"; import "../chatview/index.js"; import './loginpanel.js'; import ControlBoxMixin from './model.js'; -import ControlBoxPane from './pane.js'; import ControlBoxToggle from './toggle.js'; import ControlBoxView from './view.js'; import controlbox_api from './api.js'; @@ -96,7 +95,6 @@ converse.plugins.add('converse-controlbox', { _converse.ControlBoxView = ControlBoxView; _converse.ControlBox = _converse.ChatBox.extend(ControlBoxMixin); - _converse.ControlBoxPane = ControlBoxPane; _converse.ControlBoxToggle = ControlBoxToggle; /******************** Event Handlers ********************/ diff --git a/src/plugins/controlbox/pane.js b/src/plugins/controlbox/pane.js deleted file mode 100644 index 09311dc02..000000000 --- a/src/plugins/controlbox/pane.js +++ /dev/null @@ -1,19 +0,0 @@ -import { View } from '@converse/skeletor/src/view'; -import { api } from '@converse/headless/core'; - -const ControlBoxPane = View.extend({ - tagName: 'div', - className: 'controlbox-pane', - - initialize () { - /** - * Triggered once the {@link _converse.ControlBoxPane} has been initialized - * @event _converse#controlBoxPaneInitialized - * @type { _converse.ControlBoxPane } - * @example _converse.api.listen.on('controlBoxPaneInitialized', view => { ... }); - */ - api.trigger('controlBoxPaneInitialized', this); - } -}); - -export default ControlBoxPane; diff --git a/src/plugins/controlbox/templates/controlbox.js b/src/plugins/controlbox/templates/controlbox.js index 9176ad259..a98094c15 100644 --- a/src/plugins/controlbox/templates/controlbox.js +++ b/src/plugins/controlbox/templates/controlbox.js @@ -9,13 +9,15 @@ export default (o) => html`
${ o.connected ? html` - - - ` +
+ + + +
` : ( o['active-form'] === 'register' - ? html`` - : html`` + ? html`` + : html`` ) }
diff --git a/src/plugins/controlbox/view.js b/src/plugins/controlbox/view.js index 06468592e..634557aac 100644 --- a/src/plugins/controlbox/view.js +++ b/src/plugins/controlbox/view.js @@ -48,8 +48,6 @@ class ControlBoxView extends ElementView { const connection = _converse?.connection; if (!connection?.connected || !connection?.authenticated || connection?.disconnecting) { this.classList.add('logged-out'); - } else if (this.model.get('connected')) { - this.renderControlBoxPane(); } } @@ -57,27 +55,6 @@ class ControlBoxView extends ElementView { this.model.get('connected') && this.render(); } - /** - * Renders the "Contacts" panel of the controlbox. - * This will only be called after the user has already been logged in. - * @private - * @method _converse.ControlBoxView.renderControlBoxPane - */ - renderControlBoxPane () { - if (this.loginpanel) { - this.loginpanel.remove(); - delete this.loginpanel; - } - if (this.controlbox_pane && u.isVisible(this.controlbox_pane.el)) { - return; - } - this.classList.remove('logged-out'); - this.controlbox_pane = new _converse.ControlBoxPane(); - this - .querySelector('.controlbox-panes') - .insertAdjacentElement('afterBegin', this.controlbox_pane.el); - } - async close (ev) { if (ev && ev.preventDefault) { ev.preventDefault();