Skip to content
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

waitForImage should call callback if image is already loaded #2714

Closed
engineering-this opened this issue Jan 2, 2019 · 1 comment · Fixed by #2683
Closed

waitForImage should call callback if image is already loaded #2714

engineering-this opened this issue Jan 2, 2019 · 1 comment · Fixed by #2683
Assignees
Labels
changelog:skip A changelog entry should not be added for a given issue. status:confirmed An issue confirmed by the development team. target:minor Any docs related issue that can be merged into a master or major branch. type:task Any other issue (refactoring, typo fix, etc).
Milestone

Comments

@engineering-this
Copy link
Contributor

Type of report

Task

Provide description of the task

Test tool waitForImage calls callback on load event, but when image is already loaded this event will never happen, and some browsers might load images earlier than others.

https://github.com/ckeditor/ckeditor-dev/blob/master/tests/plugins/uploadfile/_helpers/waitForImage.js

I propose to add if branch:

else if ( image.$.complete )  {
    callback()
}

Other details

  • Browser: …
  • OS: …
  • CKEditor version: …
  • Installed CKEditor plugins: …
@engineering-this engineering-this added type:task Any other issue (refactoring, typo fix, etc). status:confirmed An issue confirmed by the development team. labels Jan 2, 2019
@engineering-this engineering-this self-assigned this Jan 2, 2019
@mlewand
Copy link
Contributor

mlewand commented Feb 5, 2019

To be consistent the callback should be called asynchronously - other than that I think it's an ok enhancement.

@mlewand mlewand added target:minor Any docs related issue that can be merged into a master or major branch. changelog:skip A changelog entry should not be added for a given issue. labels Feb 8, 2019
@mlewand mlewand added this to the 4.12.0 milestone Feb 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:skip A changelog entry should not be added for a given issue. status:confirmed An issue confirmed by the development team. target:minor Any docs related issue that can be merged into a master or major branch. type:task Any other issue (refactoring, typo fix, etc).
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants