transistor 0.1.12 → 0.1.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/build/min/transistor-backbone.js +1 -1
- data/build/src/transistor-backbone.js +1 -1
- data/js/transistor/backbone-collection.js +1 -1
- data/lib/assets/javascripts/transistor-backbone.js +1 -1
- data/spec/javascripts/TransistorBackboneCollectionSpec.js +3 -3
- data/transistor.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d178c3147bacf80e1c61f14dd8ecd04fed439e7
|
4
|
+
data.tar.gz: 2453e312f4f8d6464c102c7b75ef335da734bfba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 785123f561c28cd6a201337b568eba543e5fe7727702855864110599b6640237733335178e2e392a2c5602a16077e95ecafa69380c2edfdd7710bcd80ac3838e
|
7
|
+
data.tar.gz: 112d86e77d2a34378f3dafcc7ad2e76b37be20fb9ceb07a469a47bec82179c7ff8203a055c7e372d9ae0615ec746a1868bcfa4a4b9d5977a2bdf36db4662a1c2
|
data/Gemfile.lock
CHANGED
@@ -1 +1 @@
|
|
1
|
-
if(window.Transistor===undefined){window.Transistor={}}(function(k){var
|
1
|
+
if(window.Transistor===undefined){window.Transistor={}}(function(k){var q=(function(){return function(e){var l,r,h,o,f,s,b,g,i,p,n;l=e.backbone;r=e.underscore;h=e.channel;o=e.radio;f=e.control;s=(function(){return{}}());b=new l.Collection();b.on('change',function(a,c){var d=(a.get('object')||{}),j=a.id;if(c.from_radiotower===undefined){if(!f){throw"BackboneCollection is not mutable by user. The model with id "+a.id+" has been changed";}else{delete d.id;f.update(h,j,d)}}});g={add:b.add,remove:b.remove,reset:b.reset,set:b.set};i={add:function(a){f.insert(h,a)},remove:function(a){f.remove(h,a.id)},set:function(a){f.set(h,a)}};i.reset=i.set;(function(d){var j=true,m=function(c){d[c]=(function(a){return function(){if(j){if(!f){throw"BackboneCollection is not mutable by user.";}else{i[a].apply(i,arguments)}}else{return g[a].apply(b,arguments)}}}(c))};g.asPublic=function(a){j=false;a();j=true};m('add');m('remove');m('reset');m('set')}(b));n=function(d){g.asPublic(function(){var a=[],c;for(c=0;c<d.length;c+=1){a.push(new l.Model(d[c]))}b.set(a)})};p=k.Binder({init:function(a){n(a);if(e.on_init!==undefined){e.on_init(b)}},set:n,insert:function(a){g.asPublic(function(){b.add(new l.Model(a))})},update:function(c,d){g.asPublic(function(){var a=b.get(c);a.clear({silent:true});a.set(d,{from_radiotower:true})})},remove:function(c){g.asPublic(function(){var a=b.get(c);b.remove(a)})}});o.tune(h,p);return b}}());if(k.Backbone===undefined){k.Backbone={}}k.Backbone.Collection=q}(window.Transistor));
|
@@ -23,7 +23,7 @@ if (window.Transistor === undefined) {
|
|
23
23
|
|
24
24
|
backbone_collection = new Backbone.Collection();
|
25
25
|
backbone_collection.on('change', function (model, options) {
|
26
|
-
var entry =
|
26
|
+
var entry = (model.get('object') || {}),
|
27
27
|
id = model.id;
|
28
28
|
|
29
29
|
if (options.from_radiotower === undefined) {
|
@@ -23,7 +23,7 @@ if (window.Transistor === undefined) {
|
|
23
23
|
|
24
24
|
backbone_collection = new Backbone.Collection();
|
25
25
|
backbone_collection.on('change', function (model, options) {
|
26
|
-
var entry =
|
26
|
+
var entry = (model.get('object') || {}),
|
27
27
|
id = model.id;
|
28
28
|
|
29
29
|
if (options.from_radiotower === undefined) {
|
@@ -23,7 +23,7 @@ if (window.Transistor === undefined) {
|
|
23
23
|
|
24
24
|
backbone_collection = new Backbone.Collection();
|
25
25
|
backbone_collection.on('change', function (model, options) {
|
26
|
-
var entry =
|
26
|
+
var entry = (model.get('object') || {}),
|
27
27
|
id = model.id;
|
28
28
|
|
29
29
|
if (options.from_radiotower === undefined) {
|
@@ -126,14 +126,14 @@ describe("Transistor.Backbone.Collection", function () {
|
|
126
126
|
});
|
127
127
|
|
128
128
|
it('delegates model change events to update', function () {
|
129
|
-
radio.trigger('news', 'init', [{id: 100, a:2, b:3}, {id: 101, a:12, b:23}]);
|
129
|
+
radio.trigger('news', 'init', [{id: 100, a:2, b:3}, {id: 101, object: 133, a:12, b:23}]);
|
130
130
|
|
131
131
|
var model = collection.get(101);
|
132
132
|
|
133
|
-
model.set('
|
133
|
+
model.set('object', {attr: 24});
|
134
134
|
|
135
135
|
assertEqual(control.calls, [
|
136
|
-
['update', ['news', 101, {
|
136
|
+
['update', ['news', 101, {attr: 24}]]
|
137
137
|
]);
|
138
138
|
})
|
139
139
|
});
|
data/transistor.gemspec
CHANGED