-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: master
Are you sure you want to change the base?
Conversation
src/components/images/draw.js
Outdated
@@ -99,11 +99,11 @@ module.exports = function draw(gd) { | |||
var dataURL = canvas.toDataURL('image/png'); | |||
|
|||
thisImage.attr('xlink:href', dataURL); | |||
resolve(); |
There was a problem hiding this comment.
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();
test/jasmine/tests/plot_api_test.js
Outdated
@@ -100,6 +100,35 @@ describe('Test plot api', function() { | |||
}) | |||
.then(done); | |||
}); | |||
|
|||
it('accepts images in layout which it renders', function(done) { |
There was a problem hiding this comment.
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.
Thanks very much @HenryKeen ! PR away once my two small comments are addressed 🚀 |
Great stuff! Thanks @etpinard. PR submitted |
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.