mediawiki-extensions-Visual.../modules/ve-mw/init/styles/ve.init.mw.ViewPageTarget.css
Timo Tijhof 62c1d64ad0 mw.ViewPageTarget: Use CSS instead of JS for DOM hiding/muting
* Use .ve-activated for elements changed in activate()
  - hideReadOnlyContent()
  - mutePageContent()
  - mutePageTitle

* Use .ve-active for elements changed in onSurfaceReady()
  - hidePageContent()

* Set 've-activated' class from activate() instead of transformPage()
  to consolidate reflows and minimise DOM interaction. It's still
  in the same (synchronous) execution path, but a few statements
  earlier now.

* Remove obsolete #toc wrapper. This <div> (with data property
  to distinguish it from potentially foreign parents in the future)
  was there to aid slideDown/slideUp animations, because those
  don't work well on table elements. See eba7d58dd1.

* Remove obsolete setTimeout in restorePageTitle().
  The removal of .ve-init-mw-viewPageTarget-pageTitle was delayed
  by one second (introduced in Ibc3fa2fb7 / 4cc88b9850). This
  was to account for a jQuery animation we no longer use.

* Remove unused '.ve-init-mw-viewPageTarget-transform-muted'
* Remove unused '.ve-init-mw-viewPageTarget-transform'
* Remove unused '.ve-init-mw-viewPageTarget-pageTitle'

The resulting stylesheet exposes that we're not consistent in
whether elements hide immediately (ve-activated) or once the
surface is ready (ve-active). This is intentionally kept as-is
within this commit.

Of the different elements that had their opacity changed, only
firstHeading was being animated. This animation was removed.

Bug: T88590
Bug: T87160
Change-Id: I87033456f715d99a88425e38e8ac5171144f4ec8
2015-02-04 19:24:29 -08:00

70 lines
1.8 KiB
CSS

/*!
* VisualEditor MediaWiki Initialization ViewPageTarget styles.
*
* @copyright 2011-2015 VisualEditor Team and others; see AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
*/
/*!
* State | <html> classes
* Reading | ve-available
* Activate editor | ve-available ve-activated ve-activating
* Active | ve-available ve-activated ve-active
* Deactivate editor | ve-available ve-deactivating
* Deactivated | ve-available
*/
.ve-activated #contentSub,
.ve-activated #toc,
/* Most of bodyContent can be hidden as VE has an equivalent of most children
in ve-init-target (sibling of #bodyContent). However, we can't hide it
completely as #siteSub should remain visible (for persistence with read mode),
and ve-ui-mwTocWidget is also part of #bodyContent. */
.ve-active #bodyContent > :not(#siteSub):not(.ve-ui-mwTocWidget),
.ve-active #t-print,
.ve-active #t-permalink,
.ve-active #p-coll-print_export,
.ve-active #t-cite {
display: none;
}
.ve-activating #bodyContent,
.ve-activated #firstHeading,
.ve-activated #siteSub {
opacity: 0.6;
}
.ve-activated #firstHeading {
cursor: default;
}
/* Toolbar */
.ve-init-mw-viewPageTarget-toolbar-utilities,
.ve-init-mw-viewPageTarget-toolbar-actions {
display: inline-block;
vertical-align: middle;
}
.ve-init-mw-viewPageTarget-toolbar-actions {
font-size: 0.8em;
vertical-align: top;
padding: 0.25em;
}
.ve-init-mw-viewPageTarget-toolbar-utilities > .oo-ui-buttonElement-frameless {
margin-right: 0.2em;
margin-top: 0.2em;
}
.ve-init-mw-viewPageTarget-toolbar-actions > .oo-ui-buttonElement-framed {
margin-left: 0.25em;
margin-right: 0.25em;
margin-top: 0.2em;
}
/* Needs to override .oo-ui.widget.oo-ui-widget-disabled */
.ve-init-mw-viewPageTarget-waiting.oo-ui-widget.oo-ui-widget-disabled {
cursor: progress;
}