|
@@ -323,9 +323,7 @@
|
|
|
|
|
|
onControlBoxToggleHidden: function () {
|
|
onControlBoxToggleHidden: function () {
|
|
this.$el.show('fast', function () {
|
|
this.$el.show('fast', function () {
|
|
- if (converse.rosterview) {
|
|
|
|
- converse.rosterview.updateOnlineCount();
|
|
|
|
- }
|
|
|
|
|
|
+ converse.controlboxtoggle.updateOnlineCount();
|
|
utils.refreshWebkit();
|
|
utils.refreshWebkit();
|
|
converse.emit('controlBoxOpened', this);
|
|
converse.emit('controlBoxOpened', this);
|
|
}.bind(this));
|
|
}.bind(this));
|
|
@@ -680,6 +678,12 @@
|
|
|
|
|
|
initialize: function () {
|
|
initialize: function () {
|
|
this.render();
|
|
this.render();
|
|
|
|
+ converse.on('initialized', function () {
|
|
|
|
+ converse.roster.on("add", this.updateOnlineCount, this);
|
|
|
|
+ converse.roster.on('change', this.updateOnlineCount, this);
|
|
|
|
+ converse.roster.on("destroy", this.updateOnlineCount, this);
|
|
|
|
+ converse.roster.on("remove", this.updateOnlineCount, this);
|
|
|
|
+ }.bind(this));
|
|
},
|
|
},
|
|
|
|
|
|
render: function () {
|
|
render: function () {
|
|
@@ -696,6 +700,14 @@
|
|
return this;
|
|
return this;
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ updateOnlineCount: function () {
|
|
|
|
+ var $count = this.$('#online-count');
|
|
|
|
+ $count.text('('+converse.roster.getNumOnlineContacts()+')');
|
|
|
|
+ if (!$count.is(':visible')) {
|
|
|
|
+ $count.show();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
hide: function (callback) {
|
|
hide: function (callback) {
|
|
this.$el.fadeOut('fast', callback);
|
|
this.$el.fadeOut('fast', callback);
|
|
},
|
|
},
|