From: Jukka Kurkela Date: Tue, 16 Jun 2020 21:56:42 +0000 (+0300) Subject: Fix initial animations (#7511) X-Git-Tag: v3.0.0-beta.2~83 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c439d816fac9625cde848300f745d29acdfaf469;p=thirdparty%2FChart.js.git Fix initial animations (#7511) * Fix initial animations * CC --- diff --git a/src/core/core.controller.js b/src/core/core.controller.js index 71ac4e123..118403b6e 100644 --- a/src/core/core.controller.js +++ b/src/core/core.controller.js @@ -229,7 +229,7 @@ class Chart { this.$plugins = undefined; this.$proxies = {}; this._hiddenIndices = {}; - this.attached = true; + this.attached = false; // Add the chart instance to the global namespace Chart.instances[me.id] = me; @@ -333,16 +333,13 @@ class Chart { retinaScale(me, newRatio); if (!silent) { - // Notify any plugins about the resize plugins.notify(me, 'resize', [newSize]); - // Notify of resize - if (options.onResize) { - options.onResize(me, newSize); - } + callCallback(options.onResize, [newSize], me); - // Only apply 'resize' mode if we are attached, else do a regular update. - me.update(me.attached && 'resize'); + if (me.attached) { + me.update('resize'); + } } }