Skip to content

Commit

Permalink
build v0.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
magalhas committed Mar 16, 2015
1 parent c9cdc2b commit e51e246
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dist/backbone-react-component-min.js

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

15 changes: 11 additions & 4 deletions dist/backbone-react-component.js
@@ -1,7 +1,7 @@
// Backbone React Component
// ========================
//
// Backbone.React.Component v0.8.0-beta.1
// Backbone.React.Component v0.8.0
//
// (c) 2014 "Magalhas" José Magalhães <magalhas@gmail.com>
// Backbone.React.Component can be freely distributed under the MIT license.
Expand Down Expand Up @@ -172,17 +172,24 @@
// Use `nextProps` or `component.props` and grab `model` and `collection`
// from there
var props = nextProps || component.props || {};
var model, collection;

if (component.overrideModel && typeof component.overrideModel === 'function'){
// Define overrideModel() method on your `React class` to programatically supply a model object
// Will override `this.props.model`
props.model = component.overrideModel();
model = component.overrideModel();
} else {
model = props.model;
}

if (component.overrideCollection && typeof component.overrideCollection === 'function'){
// Define overrideCollection() method on your `React class` to programatically supply a collection object
// Will override `this.props.collection`
props.collection = component.overrideCollection();
collection = component.overrideCollection();
} else {
collection = props.collection;
}
var model = props.model, collection = props.collection;

// Check if `props.model` is a `Backbone.Model` or an hashmap of them
if (typeof model !== 'undefined' && (model.attributes ||
typeof model === 'object' && _.values(model)[0].attributes)) {
Expand Down
4 changes: 2 additions & 2 deletions lib/component.js
@@ -1,7 +1,7 @@
// Backbone React Component
// ========================
//
// Backbone.React.Component v0.8.0-beta.1
// Backbone.React.Component v0.8.0
//
// (c) 2014 "Magalhas" José Magalhães <magalhas@gmail.com>
// Backbone.React.Component can be freely distributed under the MIT license.
Expand Down Expand Up @@ -189,7 +189,7 @@
} else {
collection = props.collection;
}

// Check if `props.model` is a `Backbone.Model` or an hashmap of them
if (typeof model !== 'undefined' && (model.attributes ||
typeof model === 'object' && _.values(model)[0].attributes)) {
Expand Down

0 comments on commit e51e246

Please sign in to comment.