Skip to content

Instantly share code, notes, and snippets.

@patrixd
Last active December 31, 2015 19:59
Show Gist options
  • Save patrixd/8037277 to your computer and use it in GitHub Desktop.
Save patrixd/8037277 to your computer and use it in GitHub Desktop.
Before of the last }).call(this); from Backbone.js or Backbone.js.min add the next to allow to work with options like in the previous versions before it was removed since version 1.1Previously the options argument were attached as this.options automatically.
var BackboneView = Backbone.View;
Backbone.View = BackboneView.extend({
constructor: function (options) {
this._configure(options || {});
BackboneView.prototype.constructor.apply(this, arguments);
},
_configure: function (options) {
if (this.options) options = _.extend({}, _.result(this, 'options'), options);
//_.extend(this, _.pick(options, viewOptions));
this.options = options;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment