calzoneman / sync

Node.JS Server and JavaScript/HTML Client for synchronizing online media
Other
1.46k stars 234 forks source link

large chat emotes break auto scrolling #360

Closed sammoth closed 10 years ago

sammoth commented 10 years ago

We have some oversized chat emotes (larger vertically than one line of text) and when posted into the chat, the chat doesn't automatically scroll down enough to show them, and (not sure if it's related but) the image also loads half a second after the message is shown despite being cached.

This happens on Chrome only*, the cache seems to be slower somehow.

calzoneman commented 10 years ago

Can you provide an example of an image with does so?

I know that chat doesn't scroll enough for non-cached images because the scrolling happens before the browser loads the image and sets the size. However, for cached images this is not an issue.

I tested this with a rather large image on both Firefox and Chromium and after the initial caching I had no problems with scrolling.

sammoth commented 10 years ago

Yes you can see examples in our chat if you are here now http://synchtube.6irc.net/r/kpg2# (may be a somewhat silly)

This is one example image: https://www.googledrive.com/host/0B3dM3srfBf8XbHhUbDhJcGs1X0k/images/aing.gif or https://www.googledrive.com/host/0B3dM3srfBf8XbHhUbDhJcGs1X0k/images/aing3.gif

calzoneman commented 10 years ago

I've modified the chat handler to attach an event listener for image loads and re-scroll. This should fix the issue regardless of whether it's cached.

I'll have to bug bush to update synchtube.6irc.net.

sammoth commented 10 years ago

Thanks very much that was super quick! Might paste the fix into our channel in the mean time. Much appreciated!