controlbox: use `sticky_controlbox` setting to reduce inverse code

This commit is contained in:
JC Brand 2017-06-15 15:01:29 +02:00
parent 3e42fb53e5
commit 3181956b61
2 changed files with 6 additions and 14 deletions

View File

@ -297,6 +297,9 @@
close: function (ev) { close: function (ev) {
if (ev && ev.preventDefault) { ev.preventDefault(); } if (ev && ev.preventDefault) { ev.preventDefault(); }
if (_converse.sticky_controlbox) {
return;
}
if (_converse.connection.connected && !_converse.connection.disconnecting) { if (_converse.connection.connected && !_converse.connection.disconnecting) {
this.model.save({'closed': true}); this.model.save({'closed': true});
} else { } else {
@ -315,6 +318,9 @@
}, },
hide: function (callback) { hide: function (callback) {
if (_converse.sticky_controlbox) {
return;
}
this.$el.addClass('hidden'); this.$el.addClass('hidden');
utils.refreshWebkit(); utils.refreshWebkit();
_converse.emit('chatBoxClosed', this); _converse.emit('chatBoxClosed', this);

View File

@ -41,20 +41,6 @@
}, },
ControlBoxView: { ControlBoxView: {
close: function (ev) {
if (ev && ev.preventDefault) {
ev.preventDefault();
}
// The controlbox cannot be closed.
},
hide: function (ev) {
if (ev && ev.preventDefault) {
ev.preventDefault();
}
// The controlbox cannot be hidden
},
renderContactsPanel: function () { renderContactsPanel: function () {
this.__super__.renderContactsPanel.apply(this, arguments); this.__super__.renderContactsPanel.apply(this, arguments);
this.el.classList.remove("fullscreen"); this.el.classList.remove("fullscreen");