--- a/backbone.shard.js Thu Dec 13 03:19:14 2012 +0900
+++ b/backbone.shard.js Thu Dec 13 04:02:52 2012 +0900
.on('all', function(event, model) {
- if (/^change/.test(event) && this._filter(model) && this.models.indexOf(model) != -1) {
+ if (event == 'change') {
+ if (this._filter(model) && _(this.models).contains(model)) {
+ this.trigger.apply(this, arguments);
+ if (this._filter(model) && !_(this.models).contains(model)) {
+ this.models.push(model);
+ this.trigger('add', model);
+ if (!this._filter(model) && _(this.models).contains(model)) {
+ this.models = _.without(this.models, model);
+ this.trigger('remove', model);
+ } else if (/^change:/.test(event) && this._filter(model) && _(this.models).contains(model)) {
this.trigger.apply(this, arguments);
.on('add', function(model) {
- if (this._filter(model) && this.models.indexOf(model) == -1) {
+ if (this._filter(model) && !_(this.models).contains(model)) {
this.trigger('add', model);
.on('remove', function(model) {
- if (this._filter(model) && this.models.indexOf(model) != -1) {
+ if (this._filter(model) && _(this.models).contains(model)) {
this.models = _.without(this.models, model);
this.trigger('remove', model);