From 91633220f81f8679edbcec24cfec466512634a3a Mon Sep 17 00:00:00 2001 From: Christian Seifert Date: Tue, 28 Jul 2015 22:21:50 +0200 Subject: [PATCH] fix "TypeError: Cannot read property '_bound' of undefined" in angular2 environment --- lib/timeline/Core.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/timeline/Core.js b/lib/timeline/Core.js index d0cffbbb..f4e04c48 100644 --- a/lib/timeline/Core.js +++ b/lib/timeline/Core.js @@ -265,7 +265,7 @@ Core.prototype.setOptions = function (options) { onRender: options.drawPoints }; } - + if ('hiddenDates' in this.options) { DateUtil.convertHiddenOptions(this.options.moment, this.body, this.options.hiddenDates); } @@ -900,8 +900,10 @@ Core.prototype._stopAutoResize = function () { } // remove event listener on window.resize - util.removeEventListener(window, 'resize', this._onResize); - this._onResize = null; + if (this._onResize) { + util.removeEventListener(window, 'resize', this._onResize); + this._onResize = null; + } }; /**