151:0178573216e3
Anton Shestakov <av6@dwimlabs.net>, Thu, 14 Apr 2016 02:05:24 +0800
index: remove offline contacts only when they change to being offline Since new contacts are currently added while they still have the default presence of 'unavailable', add event sees them as offline and throws them away immediately, before their presence could change to something else.

next change 247:fcca53a2f523
previous change 131:293d0d3e7ff6

js/sidebar.js

Permissions: -rw-r--r--

Other formats: Feeds:
// Generated by CoffeeScript 1.10.0
(function() {
var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
window.Tram.SidebarApp = (function(superClass) {
extend(SidebarApp, superClass);
function SidebarApp() {
this.disconnect = bind(this.disconnect, this);
this.show = bind(this.show, this);
this.minify = bind(this.minify, this);
this.getPipColor = bind(this.getPipColor, this);
return SidebarApp.__super__.constructor.apply(this, arguments);
}
SidebarApp.prototype.colors = Tram.colors.show;
SidebarApp.prototype.initialize = function() {
return this.render();
};
SidebarApp.prototype.getPipColor = function(show) {
return "background: " + (this.colors[show] || this.colors['default']) + ";";
};
SidebarApp.prototype.minify = function() {
var minified;
minified = !this.model.get('sidebar/minified');
this.model.set('sidebar/minified', minified);
return this.$el.parent().toggleClass('mini', minified);
};
SidebarApp.prototype.show = function(event) {
var $btn, show, status;
$btn = $(event.currentTarget);
show = $btn.attr('data-show');
status = $btn.text().trim();
return this.model.trigger('action/show', show, status);
};
SidebarApp.prototype.disconnect = function() {
return this.model.trigger('action/disconnect');
};
SidebarApp.prototype.render = function() {
this.rivet = rivets.bind(this.el, {
model: this.model,
view: this
});
return this;
};
SidebarApp.prototype.remove = function() {
this.rivet.unbind();
return SidebarApp.__super__.remove.apply(this, arguments);
};
return SidebarApp;
})(Backbone.View);
}).call(this);
//# sourceMappingURL=sidebar.js.map