Last active
December 31, 2015 19:59
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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