[wp-trac] [WordPress Trac] #24716: Grid view for the Media Library

WordPress Trac noreply at wordpress.org
Sun Jul 27 17:04:37 UTC 2014

#24716: Grid view for the Media Library
 Reporter:  alexvorn2       |       Owner:
     Type:  task (blessed)  |      Status:  new
 Priority:  normal          |   Milestone:  4.0
Component:  Media           |     Version:
 Severity:  normal          |  Resolution:
 Keywords:                  |     Focuses:  ui, javascript, administration

Comment (by afercia):

 Replying to [comment:139 kovshenin]:
 > ... the scroll method keeps firing from ready() up until all attachments
 are loaded on the page. Looks like we need to watch for the scroll event
 on the document, rather than the view.
 Great, it works for me, but with the "refreshThreshold" value set to 3
 maybe it's still loading too many attachments. I've tested with 200
 attachments and on the first page load, it fires 4 ajax requests each one
 with "posts_per_page" set to 40 so the final results is 160 attachments.
 Your mileage may vary depending on the thumbnail size, your screen size
 (if you have your browser window maximized) or if you shrink your browser
 window height, you may get 3 or 4 requests. But basically it keeps loading
 attachments till the body scrollHeight is less than its clientHeight * 3.
 Sort of 3 "pages" of thumbnails.
 Also, I'm not so sure the "refreshThreshold" should multiply, in all
 infinite scroll implementations I've seen, the threshold value is *added*.
 Of course, it's better to have 160 attachments than *all* the attachments
 loaded :) But please consider to review the threshold thing. I could
 easily propose a patch arbitrarily changing "refreshThreshold" value say
 to "2" but probably this needs more testing and feedback from users with
 different devices, screen sizes etc.

Ticket URL: <https://core.trac.wordpress.org/ticket/24716#comment:142>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list