Page MenuHomePhabricator

New-style packed gallery shows ragged edges after window resize
Closed, ResolvedPublic

Description

Steps to reproduce:

Oh nooooooooo!

Probably needs some JS code to hook window 'resize' event and adjust packed galleries if horizontal size changes.

Details

Reference
bz53664
Related Gerrit Patches:

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:11 AM
bzimport added a project: MediaWiki-JavaScript.
bzimport set Reference to bz53664.
bzimport added a subscriber: Unknown Object (MLST).
brion created this task.Sep 1 2013, 6:14 PM
brion added a comment.Sep 1 2013, 6:14 PM

CCing bawolff

In the original design I was assuming that people wouldn't resize the window very much. I kind of consider resizing on window size change to be a nice feature to have, but not critical.

So part of the problem with doing this, is that the current algorithm relies on how the browser places the images initially, in order to figure out the size of the pictures.

If we keep the current algorithm, one would have to first resize the images back to the original html sizes, and then re-run the layout algorithm again, everytime the window changed size.

brion added a comment.Sep 4 2013, 4:44 PM

I think that can be worked around...

The 'natural size' of the images should be available to JavaScript directly[1], and if there's a portability problem, you can just save the original sizes in data attributes or something.

[1] https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement <- naturalWidth and naturalHeight properties at least in HTML5

matmarex updated the task description. (Show Details)Dec 31 2014, 12:41 AM
matmarex set Security to None.
matmarex added a project: good first task.

Change 182652 had a related patch set uploaded (by M4tx):
Adjust images in packed gallery on window resize

https://gerrit.wikimedia.org/r/182652

Patch-For-Review

m4tx claimed this task.Jan 4 2015, 10:14 AM

Change 182652 merged by jenkins-bot:
Adjust images in packed gallery on window resize

https://gerrit.wikimedia.org/r/182652

matmarex closed this task as Resolved.Jan 5 2015, 3:45 PM
matmarex removed a project: Patch-For-Review.
matmarex removed a subscriber: Unknown Object (MLST).

Change 183989 had a related patch set uploaded (by Bartosz Dziewoński):
Fix gallery rearrange on resize with missing images

https://gerrit.wikimedia.org/r/183989

Patch-For-Review

matmarex added a subscriber: m4tx.Jan 10 2015, 7:56 PM

(The follow-up patch was actually submitted by @m4tx too.)

Change 183989 merged by jenkins-bot:
Fix gallery rearrange on resize with missing images

https://gerrit.wikimedia.org/r/183989