322:7dfdf32e8577
Anton Shestakov <av6@dwimlabs.net>, Sat, 14 Jul 2018 20:23:13 +0800
index: authorizing contact also adds it to the roster Maybe there are cases when this doesn't make sense, but so far this looks like the right thing to do.

previous change 291:923afdc60aaf

js/progress.js

Permissions: -rw-r--r--

Other formats: Feeds:
// Generated by CoffeeScript 1.12.7
(function() {
var 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.ProgressApp = (function(superClass) {
extend(ProgressApp, superClass);
function ProgressApp() {
return ProgressApp.__super__.constructor.apply(this, arguments);
}
ProgressApp.prototype.initialize = function() {
this.listenTo(this.model, 'change:progress', this.updateProgress);
return this.render();
};
ProgressApp.prototype.updateProgress = function() {
switch (this.model.get('progress')) {
case 0:
return setTimeout((function(_this) {
return function() {
if (_this.model.get('progress') === 0) {
return _this.model.set('progress', 10);
}
};
})(this), 600);
case 100:
return setTimeout((function(_this) {
return function() {
if (_this.model.get('progress') === 100) {
return _this.model.unset('progress');
}
};
})(this), 600);
}
};
ProgressApp.prototype.render = function() {
this.rivet = rivets.bind(this.el, {
model: this.model,
view: this
});
return this;
};
ProgressApp.prototype.remove = function() {
this.rivet.unbind();
return ProgressApp.__super__.remove.apply(this, arguments);
};
return ProgressApp;
})(Backbone.View);
}).call(this);
//# sourceMappingURL=progress.js.map