Skip to content

Commit

Permalink
check for existance of window before assigning Facetr
Browse files Browse the repository at this point in the history
  • Loading branch information
francesko committed Apr 26, 2013
1 parent b024a4e commit 02e8ffd
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
6 changes: 5 additions & 1 deletion dist/backbone.facetr.js
Original file line number Diff line number Diff line change
Expand Up @@ -1132,5 +1132,9 @@
collection.on('change', _modifyModel);
};

return window.Facetr = Backbone.Facetr;
if(window){
window.Facetr = Backbone.Facetr;
}

return Backbone.Facetr;
}));
2 changes: 1 addition & 1 deletion dist/backbone.facetr.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion example/todos.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ <h4><%= facet.data.label %></h4>
// this.collection.on('reset', this.addAll, this);

this.collection.on('reset', this.addAll, this);
Facetr(this.collection).on('reset change remove add sort', this.addAll, this);
Facetr(this.collection).on('reset clear change remove add sort', this.addAll, this);

this.collection.reset(items);

Expand Down
2 changes: 1 addition & 1 deletion spec/FacetrSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ describe('Backbone.Facetr', function() {
// Facetr(collection).facet('UnexistingProperty');
// }).toThrow(new Error('Facetr cannot add a facet using a non-existent model property'));
});

// Facet
describe('returns a Facet that', function() {
// Facet toJSON
Expand Down
Loading

0 comments on commit 02e8ffd

Please sign in to comment.