From 5bf203037c667b5450093a1cd8164cef1461698e Mon Sep 17 00:00:00 2001 From: Evert Timberg Date: Tue, 29 Nov 2016 04:43:52 -0500 Subject: [PATCH] Do not notify plugins when a silent resize occurs (#3650) Prevent the resize method from notifying plugins if it is a silent resize. A silent resize occurs during startup and we do not want plugins to do anything here because the chart is not set up. --- src/core/core.controller.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/core/core.controller.js b/src/core/core.controller.js index ebbd081af..1abc81075 100644 --- a/src/core/core.controller.js +++ b/src/core/core.controller.js @@ -312,16 +312,16 @@ module.exports = function(Chart) { helpers.retinaScale(chart); - // Notify any plugins about the resize - var newSize = {width: newWidth, height: newHeight}; - Chart.plugins.notify('resize', [me, newSize]); - - // Notify of resize - if (me.options.onResize) { - me.options.onResize(me, newSize); - } - if (!silent) { + // Notify any plugins about the resize + var newSize = {width: newWidth, height: newHeight}; + Chart.plugins.notify('resize', [me, newSize]); + + // Notify of resize + if (me.options.onResize) { + me.options.onResize(me, newSize); + } + me.stop(); me.update(me.options.responsiveAnimationDuration); }