From 9b0ca8310031f05bc74e71039db8cd34cfbd4390 Mon Sep 17 00:00:00 2001 From: Tuan Ho Date: Mon, 23 Dec 2013 16:29:57 -0800 Subject: [PATCH] Apply function needs an array for options to be passed properly to View's constructor Backbone Views were not getting the options specified when they created the object. --- src/PerfView.js | 2 +- src/ReuseView.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PerfView.js b/src/PerfView.js index 8319183..fa254f8 100644 --- a/src/PerfView.js +++ b/src/PerfView.js @@ -534,7 +534,7 @@ var update = function(delta) var PerfView = Backbone.PerfView = function(opts) { // call backbone constructor - Backbone.View.prototype.constructor.apply(this, opts); + Backbone.View.prototype.constructor.apply(this, [opts]); this.collection = opts.collection; this._staticHeights = opts.staticHeights || false; diff --git a/src/ReuseView.js b/src/ReuseView.js index d9212a9..40d4c90 100644 --- a/src/ReuseView.js +++ b/src/ReuseView.js @@ -14,7 +14,7 @@ clearImgs = function(imgs) var ReuseView = Backbone.ReuseView = function(opts) { // call backbone constructor - Backbone.View.prototype.constructor.apply(this, opts); + Backbone.View.prototype.constructor.apply(this, [opts]); this.model = opts.model || null; this.forceGPUTexture = opts.forceGPUTexture || false;