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

use on-load event to trigger resizable images #5223

Merged
merged 1 commit into from Mar 3, 2014

Conversation

minrk
Copy link
Member

@minrk minrk commented Feb 25, 2014

instead of timeout, which could get incorrect size information.

closes #5219

setTimeout(function () {
// wrap image after it's loaded on the page,
// otherwise the measured initial size will be incorrect
img.on("load", function (){
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible that this ever gets called after the image has been loaded, so the callback is never called?

Copy link
Member Author

Choose a reason for hiding this comment

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

No - we explicitly call it in between creating the element and appending to the document.

instead of timeout, which could get incorrect size information.

closes ipython#5219
@jdfreder
Copy link
Member

jdfreder commented Mar 1, 2014

Looks good to me now.

ellisonbg added a commit that referenced this pull request Mar 3, 2014
use on-load event to trigger resizable images
@ellisonbg ellisonbg merged commit 9806498 into ipython:master Mar 3, 2014
@minrk minrk deleted the tiny-images branch March 31, 2014 23:36
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
use on-load event to trigger resizable images
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Output images appear as small thumbnails (Notebook)
4 participants