Skip to content

Commit

Permalink
Merge pull request #1691 from HenryKeen/fix-ie11-image-promise
Browse files Browse the repository at this point in the history
Move the promise resolution to address IE11 bug
  • Loading branch information
etpinard committed May 16, 2017
2 parents e58dcb0 + 310f762 commit a729acc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/images/draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit a729acc

Please sign in to comment.