From fb11cfe79584e8b4135090476459835722442c80 Mon Sep 17 00:00:00 2001 From: JC Brand Date: Tue, 24 Apr 2018 14:35:47 +0200 Subject: [PATCH] Add `converse-embedded` class without requiring an override --- src/converse-chatboxes.js | 1 + src/converse-muc-embedded.js | 21 +++------------------ 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/src/converse-chatboxes.js b/src/converse-chatboxes.js index f93243c79..ae99086d5 100644 --- a/src/converse-chatboxes.js +++ b/src/converse-chatboxes.js @@ -653,6 +653,7 @@ initialize () { this.model.on("add", this.onChatBoxAdded, this); this.model.on("destroy", this.removeChat, this); + this.el.classList.add(`converse-${_converse.view_mode}`); this.render(); }, diff --git a/src/converse-muc-embedded.js b/src/converse-muc-embedded.js index bc060b19f..be4b4d41d 100644 --- a/src/converse-muc-embedded.js +++ b/src/converse-muc-embedded.js @@ -1,9 +1,9 @@ -// Converse.js (A browser based XMPP chat client) +// Converse.js // http://conversejs.org // -// Copyright (c) 2012-2017, Jan-Carel Brand +// Copyright (c) 2012-2018, the Converse.js developers // Licensed under the Mozilla Public License (MPLv2) -// + (function (root, factory) { define(["converse-core", "converse-muc"], factory); }(this, function (converse) { @@ -16,21 +16,6 @@ return _converse.view_mode === 'embedded'; }, - overrides: { - // Overrides mentioned here will be picked up by converse.js's - // plugin architecture they will replace existing methods on the - // relevant objects or classes. - // - // New functions which don't exist yet can also be added. - - ChatBoxViews: { - initialize () { - this.__super__.initialize.apply(this, arguments); - this.el.classList.add('converse-embedded'); - } - } - }, - initialize () { /* The initialize function gets called as soon as the plugin is * loaded by converse.js's plugin machinery.