Page MenuHomePhabricator

Minerva section collapse is an event on H1/H2, wouldn't .mw-headline and icon be more sensible?
Closed, DeclinedPublic

Description

Maybe there were reasons..

On Minerva, sections can be collapsed - great feature! It's an event on H1/H2 though. You'd think this would cause the section to collapse when pressing the "edit section" button, but ''that'' button appears to have a stopPropagation event for this.

So everything works perfectly!

Right until you enable a gadget or script that adds links to sections. Those links cause the section to collapse/uncollapse even though that's not what you want. Now every script that does this could implement workarounds for Minerva -joy- or Minerva could put the event elsewhere.

IMHO, putting the event on H1 .mw-headline,H2 .mw-headline and H1 .mw-ui-icon-mf-expand,H2 .mw-ui-icon-mf-expand should achieve the exact same effect, and the edit section button wouldn't have to cancel the event listener anymore. And gadgets that add links to H1/H2 wouldn't have to worry about Minerva anymore.

Event Timeline

Screw it, I've worked around it anyway.

If you came here looking for a solution for your script, try:
$('H1 A,H2 A,H3 A,H4 A,H5 A,H6 A').on('click', function(event){event.stopPropagation();});.