Resolve the promise after the first image loads#1
Open
HenryKeen wants to merge 4 commits into
Open
Conversation
etpinard
reviewed
May 16, 2017
| var dataURL = canvas.toDataURL('image/png'); | ||
|
|
||
| thisImage.attr('xlink:href', dataURL); | ||
| resolve(); |
There was a problem hiding this comment.
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();
etpinard
reviewed
May 16, 2017
| .then(done); | ||
| }); | ||
|
|
||
| it('accepts images in layout which it renders', function(done) { |
There was a problem hiding this comment.
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 🚀 |
Owner
Author
|
Great stuff! Thanks @etpinard. PR submitted |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.