ImagePage: Make metadata table's initial collapse CSS-only
authorTimo Tijhof <krinklemail@gmail.com>
Tue, 5 Dec 2017 00:09:06 +0000 (00:09 +0000)
committerTimo Tijhof <krinklemail@gmail.com>
Tue, 5 Dec 2017 02:50:33 +0000 (02:50 +0000)
commit6400972eeacf17a1172e56c0ad73cdbdb4449344
tree370a67aad2b5a433f755f97d04d60e335de581d8
parent463e51203cef97cabe84a83c02a7f9325e8bf760
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
includes/page/ImagePage.php
resources/Resources.php
resources/src/mediawiki.action/mediawiki.action.view.filepage.css
resources/src/mediawiki.action/mediawiki.action.view.metadata.css
resources/src/mediawiki.action/mediawiki.action.view.metadata.js