Anton Shestakov <av6@dwimlabs.net>, Wed, 20 Jul 2016 18:56:30 +0800
fruitbar: remove encoding declaration (not necessary, the code is ascii)
static/js/framework/views/base.js
Permissions: -rw-r--r--
var CollectionView = Backbone.View.extend({ appendItem: function() {}, updateItem: function() {}, removeItem: function() {}, this.collection.each(this.appendItem, this); bindCollection: function() { .on('add', this.appendItem, this) .on('change', this.updateItem, this) .on('remove', this.removeItem, this) .on('reset', this.repopulate, this); unbindCollection: function() { this.collection.off(null, null, this); compileTemplates: function(templates) { _.each(templates, function(template, name) { this.templates[name] = _.template(template); var Displayer = Backbone.View.extend({ var CollectionCounterView = CollectionView.extend({ initialize: function(options) { if ('plurals' in options) { this.makeTitle = function(n) { return n + ' ' + options.plurals[n == 1 ? 0 : 1]; this.$el.html(this.makeTitle(this.collection.models.length));