Page MenuHomePhabricator

ReferencesDrawer should be a Drawer, not extend the Drawer
Closed, ResolvedPublic

Description

Precursors: T214049

The ReferencesDrawer extends the Drawer. It does this for several reasons:

  • To disable scroll via the closeOnScroll property
  • Override a template
  • To override the show method (but not actually do anything) 😂
  • To add a class drawer-enabled to the body tag when open and remove it when closed
  • Define events showNestedReference
  • Expose a method showReference which Minerva uses to display the reference.

Working across the MobileFrontend and Minerva codebase, we will look to disect this.

Acceptance criteria

  • closeOnScroll is a parameter to Drawer not a property on the class
  • The template of ReferencesDrawer is generalised and moved to the Drawer class (implementor should note that things extending Drawer already provide their own templates, so it would be useful to look at CtaDrawer's template when generalizing)
  • Events are passed in as properties
  • The drawer-enabled class is no longer necessary (T214049)
  • Keep Minerva stable throughout these changes!
  • Move the showReference method to the new factory function
  • defaults are passed directly into the Drawer

Event Timeline

Change 526569 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/MobileFrontend@master] ReferencesDrawer is a Drawer!!!

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

Change 529174 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/skins/MinervaNeue@master] Use showReference function rather than deprecated ReferenceDrawer

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

Change 526569 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Dev: ReferencesDrawer is a Drawer!!!

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

Change 529198 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/MobileFrontend@master] Drop backwards compatability classes

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

Change 529174 merged by jenkins-bot:
[mediawiki/skins/MinervaNeue@master] Use showReference function rather than deprecated ReferenceDrawer

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

Change 529198 merged by Jdlrobson:
[mediawiki/extensions/MobileFrontend@master] Drop backwards compatability classes

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

Jdlrobson claimed this task.