From e0e68a24c5bc5f235d071deab4b7e0d87a15c9f4 Mon Sep 17 00:00:00 2001 From: henrykeen Date: Tue, 16 May 2017 16:15:30 +0100 Subject: [PATCH 1/2] Move the promise resolution to address IE11 bug See https://github.com/plotly/plotly.js/issues/1685 for details --- src/components/images/draw.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/images/draw.js b/src/components/images/draw.js index 8242e72f23f..0c8e114e983 100644 --- a/src/components/images/draw.js +++ b/src/components/images/draw.js @@ -99,11 +99,15 @@ module.exports = function draw(gd) { var dataURL = canvas.toDataURL('image/png'); thisImage.attr('xlink:href', dataURL); + + // resolve promise in onload handler instead of on 'load' to support IE11 + // see https://github.com/plotly/plotly.js/issues/1685 + // for more details + resolve(); }; thisImage.on('error', errorHandler); - thisImage.on('load', resolve); img.src = d.source; From 310f76219b21b0668e927793e25b919690094749 Mon Sep 17 00:00:00 2001 From: henrykeen Date: Tue, 16 May 2017 16:53:28 +0100 Subject: [PATCH 2/2] fix lint --- src/components/images/draw.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/images/draw.js b/src/components/images/draw.js index 0c8e114e983..10ad4ea5564 100644 --- a/src/components/images/draw.js +++ b/src/components/images/draw.js @@ -99,9 +99,9 @@ module.exports = function draw(gd) { var dataURL = canvas.toDataURL('image/png'); thisImage.attr('xlink:href', dataURL); - + // resolve promise in onload handler instead of on 'load' to support IE11 - // see https://github.com/plotly/plotly.js/issues/1685 + // see https://github.com/plotly/plotly.js/issues/1685 // for more details resolve(); };