Skip to content

Commit e51e246

Browse files
committed
build v0.8.0
1 parent c9cdc2b commit e51e246

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

dist/backbone-react-component-min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/backbone-react-component.js

+11-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Backbone React Component
22
// ========================
33
//
4-
// Backbone.React.Component v0.8.0-beta.1
4+
// Backbone.React.Component v0.8.0
55
//
66
// (c) 2014 "Magalhas" José Magalhães <[email protected]>
77
// Backbone.React.Component can be freely distributed under the MIT license.
@@ -172,17 +172,24 @@
172172
// Use `nextProps` or `component.props` and grab `model` and `collection`
173173
// from there
174174
var props = nextProps || component.props || {};
175+
var model, collection;
176+
175177
if (component.overrideModel && typeof component.overrideModel === 'function'){
176178
// Define overrideModel() method on your `React class` to programatically supply a model object
177179
// Will override `this.props.model`
178-
props.model = component.overrideModel();
180+
model = component.overrideModel();
181+
} else {
182+
model = props.model;
179183
}
184+
180185
if (component.overrideCollection && typeof component.overrideCollection === 'function'){
181186
// Define overrideCollection() method on your `React class` to programatically supply a collection object
182187
// Will override `this.props.collection`
183-
props.collection = component.overrideCollection();
188+
collection = component.overrideCollection();
189+
} else {
190+
collection = props.collection;
184191
}
185-
var model = props.model, collection = props.collection;
192+
186193
// Check if `props.model` is a `Backbone.Model` or an hashmap of them
187194
if (typeof model !== 'undefined' && (model.attributes ||
188195
typeof model === 'object' && _.values(model)[0].attributes)) {

lib/component.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Backbone React Component
22
// ========================
33
//
4-
// Backbone.React.Component v0.8.0-beta.1
4+
// Backbone.React.Component v0.8.0
55
//
66
// (c) 2014 "Magalhas" José Magalhães <[email protected]>
77
// Backbone.React.Component can be freely distributed under the MIT license.
@@ -189,7 +189,7 @@
189189
} else {
190190
collection = props.collection;
191191
}
192-
192+
193193
// Check if `props.model` is a `Backbone.Model` or an hashmap of them
194194
if (typeof model !== 'undefined' && (model.attributes ||
195195
typeof model === 'object' && _.values(model)[0].attributes)) {

0 commit comments

Comments
 (0)