js_stack 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6604de5323557403972d16f6c48da43ecab2f29d
4
- data.tar.gz: 92652c55018ffcfb6b6cbd6a71fd3f9fd29e96b8
3
+ metadata.gz: 33417a98914df0c29f0366cc92b33fcb56adcdc9
4
+ data.tar.gz: a84af44932b4b450f53de35837111b6115d62c3f
5
5
  SHA512:
6
- metadata.gz: c860eeef034c59af8736c1b369722fb4a4929398e9a47702d54a7a96e0599b0ed7b35cbf1065e474b5fc56dc5a7085c9bbdba046141f0113f1d71abfaa9c036d
7
- data.tar.gz: 0b1c70dc89cb553bbf209722a97482cd4fbac909e0171ef58e2046922c0084fa6b712e5b1b7030b9fbc092374b851710f736f8a194996a14a237d9310102c44f
6
+ metadata.gz: c1febad1e16971d9d3d6560bec7688fb118dc3b247523412a72c0a43e076394e2049c21d5085d1a502ccfaeffc3fbe8cd509601fb95658af4044302444d10429
7
+ data.tar.gz: d3d99f95e85b3e328036a195a71474a77fa26b69ba62aa3e4b106c293809c506b312098c584ba90e21fb06115f14ca4a32d0893257ce9500b02b9b67b58ea388
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ # 1.2.2
4
+
5
+ * update backbone.virtualcollection 0.5.1 -> 0.5.2 [@gvl]
6
+
3
7
  # 1.2.1
4
8
 
5
9
  * update marionette 2.2.0 -> 2.2.1 [@gvl]
data/README.md CHANGED
@@ -65,7 +65,7 @@ Examples:
65
65
  | backbone routefilter | **0.2.1** | [changelog](https://github.com/boazsender/backbone.routefilter#release-history) | [homepage](https://github.com/boazsender/backbone.routefilter) |
66
66
  | backbone stickit | **0.8.0**, 0.7.0, 0.6.3 | [changelog](http://nytimes.github.io/backbone.stickit/#change-log) | [homepage](http://nytimes.github.io/backbone.stickit/) |
67
67
  | backbone validation | **0.9.1**, 0.8.1 | [changelog](https://github.com/thedersen/backbone.validation#release-notes) | [homepage](https://github.com/thedersen/backbone.validation) |
68
- | backbone virtualcollection | **0.5.1**, 0.4.15 | [changelog](https://github.com/p3drosola/Backbone.VirtualCollection#changelog) | [homepage](https://github.com/p3drosola/Backbone.VirtualCollection) |
68
+ | backbone virtualcollection | **0.5.2**, 0.4.15 | [changelog](https://github.com/p3drosola/Backbone.VirtualCollection#changelog) | [homepage](https://github.com/p3drosola/Backbone.VirtualCollection) |
69
69
  | cocktail | **0.5.8** | None | [homepage](https://github.com/onsi/cocktail) |
70
70
  | momentjs | **2.8.3** | [changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md) | [homepage](https://github.com/derekprior/momentjs-rails) |
71
71
  | underscore inflections | **0.2.1** | None | [homepage](https://github.com/geetarista/underscore.inflections) |
@@ -1,3 +1,3 @@
1
1
  module JsStack
2
- VERSION = '1.2.1'
2
+ VERSION = '1.2.2'
3
3
  end
@@ -1,7 +1,5 @@
1
1
 
2
- // internal data structure is compatible with
3
- // Backbone.Collection ...
4
- // mind = blown
2
+ // Available under the MIT License (MIT)
5
3
 
6
4
  (function (root, factory) {
7
5
  if (typeof define === 'function' && define.amd) {
@@ -54,9 +52,13 @@
54
52
  },
55
53
 
56
54
  _rebuildIndex: function () {
55
+ for(idx in this.models) {
56
+ this.models[idx].off('all', this._onModelEvent, this);
57
+ }
57
58
  this._reset();
58
59
  this.collection.each(function (model, i) {
59
60
  if (this.accepts(model, i)) {
61
+ model.on('all', this._onModelEvent, this);
60
62
  this.models.push(model);
61
63
  this._byId[model.cid] = model;
62
64
  if (model.id) this._byId[model.id] = model;
@@ -82,6 +84,7 @@
82
84
  _onAdd: function (model, collection, options) {
83
85
  if (this.accepts(model, options.index)) {
84
86
  this._indexAdd(model);
87
+ model.on('all', this._onModelEvent, this);
85
88
  this.trigger('add', model, this, options);
86
89
  }
87
90
  },
@@ -92,7 +95,7 @@
92
95
  var i = this._indexRemove(model)
93
96
  , options_clone = _.clone(options);
94
97
  options_clone.index = i;
95
-
98
+ model.off('all', this._onModelEvent, this);
96
99
  this.trigger('remove', model, this, options_clone);
97
100
  },
98
101
 
@@ -155,6 +158,7 @@
155
158
  },
156
159
 
157
160
  _indexRemove: function (model) {
161
+ model.off('all', this._onModelEvent, this);
158
162
  var i = this.indexOf(model);
159
163
  if (i === -1) return i;
160
164
  this.models.splice(i, 1);
@@ -1 +1 @@
1
- //= require js_stack/plugins/backbone/virtualcollection/0.5.1
1
+ //= require js_stack/plugins/backbone/virtualcollection/0.5.2
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: js_stack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomasz Pewiński
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-10-09 00:00:00.000000000 Z
12
+ date: 2014-10-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: haml_coffee_assets
@@ -142,7 +142,7 @@ files:
142
142
  - vendor/assets/javascripts/js_stack/plugins/backbone/validation/0.8.1.js
143
143
  - vendor/assets/javascripts/js_stack/plugins/backbone/validation/0.9.1.js
144
144
  - vendor/assets/javascripts/js_stack/plugins/backbone/virtualcollection/0.4.15.js
145
- - vendor/assets/javascripts/js_stack/plugins/backbone/virtualcollection/0.5.1.js
145
+ - vendor/assets/javascripts/js_stack/plugins/backbone/virtualcollection/0.5.2.js
146
146
  - vendor/assets/javascripts/js_stack/plugins/cocktail.js
147
147
  - vendor/assets/javascripts/js_stack/plugins/cocktail/0.5.8.js
148
148
  - vendor/assets/javascripts/js_stack/plugins/moment.js