Topic on Extension talk:MobileFrontend

Sections not collapsed or collapsible

8
Tinss (talkcontribs)

Hello, I'm using MF REL1_34 on MW 1.34. For some reason, the ability to expand/collapse sections on pages has completely disappeared. Here is a live example. $wgMFCollapseSectionsByDefault = true; in my configuration.

Looking at the HTML it seems no elements that pertain to the collapsing are being added so this may me be a back-end issue.

Garuda3 (talkcontribs)

I've just installed the extension and it isn't working for me either. Were collapsible sections fully supported beforehand? My infoboxes rely on them.

Knomanii (talkcontribs)

I had this issue on a couple pages on my wiki version 1.34.2 and determined that I had a div wrapped around multiple sections was messing up the collapsible sections. Not sure if this is your issue or not, but you could check the page and make sure there aren't any html elements like a <div> wrapping around multiple sections.

Edit: Looking at your site, I notice that on your h2 looks like <h2> whereas on a working collapsible h2 it should appear like <h2 class="section-heading collapsible-heading open-block" tabindex="0" aria-haspopup="true" aria-controls="content-collapsible-block-0">.

So MobileFrontEnd must be having trouble interpreting the h2 correctly. I can't view the page's source code, so I'm unable to determine the cause, but I'd guess it's the page's source code. If not that, I'd make sure that nothing in Mobile.css or Mobile.js is messing things up.

Garuda3 (talkcontribs)

Thanks for this, I've made a mistake here. I thought the OP was referring to collapsible tables such as those with class mw-collapsible. Unfortunately it doesn't look like this was supported at all, but I'm not sure.

Knomanii (talkcontribs)

Ah, thanks for clarifying. Yeah I think OP was referring to <h2>'s which are collapsible in MobileFrontEnd. Whereas mw-collapsible is not, which is evident if you check out the collapsible examples in Manual:Collapsible_elements in Mobile View. None of the examples are collapsible in Mobile View, so it appears to not be supported.

I see a few phabricator tickets about mw-collapsible and MobileFrontend (phab:T71773, phab:T55136), and in general it seems their thought is that 'too many toggleable elements would be a bad design' and that 'Navboxes are hidden on mobile as they are generally cluttered and not mobile friendly.' Although, here is a newer ticket (phab:T111565) where it is being discussed again.

If you're intent on it, the one possible workaround I found was on some HelpDesk Tickets (Topic:Tobruzg16mrbs8f3 and Topic:U9dr0palyjw9fxkd) about this issue, someone mentions: "You'll need to add the jquery.makeCollapsible module which is not added by default on the Minerva skin."

I'm not sure how to do that, so this may not be super helpful, but perhaps it's a starting point if you're intent on getting collapsible infoboxes working. My own approach was just to give them the class "nomobile" so they didn't display on mobile, but I realize that may or may not make sense for your content.

Garuda3 (talkcontribs)

Indeed, thanks for your help.

I have been reading over the documentation for JavaSript modules which aren't loaded in MobileFrontend. This is where my experience ends, I did try a quick fix but it broke the wiki so I'll have to dig a bit deeper!

Anyone reading this looking for mobile support, I'm currently using Skin:Refreshed which has worked well for me over six years, though MobileFrontend has now caught up in terms of available features.

Knomanii (talkcontribs)

Nice, yeah my next thought was setting a different default skin for MobileFrontend, but you're already on it.

Tinss (talkcontribs)

Dumped a couple more hours into this problem and I've tracked it down to src/mobile.init/mobile.init.js (it's minified version to be precise). That file takes care of enabling the collapsing of section and it's simply not being called. I've tried loading it manually but it has too many convoluted dependencies and I can't properly debug their minified code.

I'm going to need to open a phabricator task...

Reply to "Sections not collapsed or collapsible"