Skip to content

Resolve the promise after the first image loads #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

HenryKeen
Copy link
Owner

@HenryKeen HenryKeen commented May 16, 2017

Fixes plotly#1685

As there is no test runner for IE11 the test is just to give coverage for other browsers. A manual test has asserted that has fixed the problem in IE11.

@HenryKeen HenryKeen added the bug label May 16, 2017
@@ -99,11 +99,11 @@ module.exports = function draw(gd) {
var dataURL = canvas.toDataURL('image/png');

thisImage.attr('xlink:href', dataURL);
resolve();
Copy link

@etpinard etpinard May 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Could you add a comment above to make sure we remember why that resolve is there? Something like:

// 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();

@@ -100,6 +100,35 @@ describe('Test plot api', function() {
})
.then(done);
});

it('accepts images in layout which it renders', function(done) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to for this. We already have a full suite of layout.images tests in:

https://github.com/plotly/plotly.js/blob/master/test/jasmine/tests/layout_images_test.js


We don't currently run any CI test on IE unfortunately, so yeah, your patch won't be supported by any tests at the moment 😞 .

We did try to get an Appveyor CI box running (see plotly#431) but that effort came up short.

@etpinard
Copy link

Thanks very much @HenryKeen ! PR away once my two small comments are addressed 🚀

@HenryKeen
Copy link
Owner Author

Great stuff! Thanks @etpinard. PR submitted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Promises from images never resolving in IE11
2 participants