Download:
child 20:bee99bc96b9f
parent 18:fa1c928c7a44
19:bce86fd15801
Anton Shestakov <av6@dwimlabs.net>, Wed, 22 Jun 2016 13:22:40 +0800
backbone.shard: strip trailing spaces

1 файлов изменено, 6 вставок(+), 6 удалений(-) [+]
backbone.shard.js file | annotate | diff | comparison | revisions
--- a/backbone.shard.js Wed Jun 22 13:19:44 2016 +0800
+++ b/backbone.shard.js Wed Jun 22 13:22:40 2016 +0800
@@ -1,8 +1,8 @@
/*
* backbone.shard.js.
- *
+ *
* (c) 2013 Anton Shestakov.
- *
+ *
* This extension to Backbone may be freely distributed
* under the MIT license:
* http://opensource.org/licenses/mit-license.php
@@ -11,9 +11,9 @@
Backbone.Shard = function(options) {
this._collection = options.collection;
this._filter = options.filter;
-
+
this.models = this._collection.filter(this._filter);
-
+
this._collection
.on('all', function(event, model) {
if (event == 'change') {
@@ -48,13 +48,13 @@
this.models = this._collection.filter(this._filter);
this.trigger('reset');
}, this);
-
+
this.initialize.apply(this, arguments);
};
_.extend(Backbone.Shard.prototype, Backbone.Events, {
initialize: function() {},
-
+
pluck: function(attr) {
return _.map(this.models, function(model) { return model.get(attr); });
}