HomePhabricator

ImagePage: Make metadata table's initial collapse CSS-only

Authored by Krinkle on Dec 5 2017, 12:09 AM.

Description

ImagePage: Make metadata table's initial collapse CSS-only

Make the initial collapse of the metadata table not depend on
JavaScript. This eliminates the FOUC, and will also reduce JS
footprint once compat can be removed.

  • Move the 'display: none;' styles from metadata.css to filepage.css so that they are part of the base styles for file pages (metadata.css is only for supporting metadata.js, which is loaded dynamically).
  • Apply "collapsed" class from the PHP side immediately, instead of calling "addClass" in JavaScript.
  • Restrict hide-styles to only apply under .client-js to make sure the rows remain visible in no-js mode.
  • Declare dependency between metadata.js and filepage.css. This is just for documentation purposes, as they are both already separately loaded on all file pages.

Change-Id: If22bf7acb47b59151dc3b0843a62507c100e548b

Details

Committed
KrinkleDec 5 2017, 2:50 AM
Parents
rMW463e51203cef: ImagePage: Clean up metadata.js collapsing
Branches
Unknown
Tags
Unknown
ChangeId
If22bf7acb47b59151dc3b0843a62507c100e548b