Page MenuHomePhabricator

Using mw-collapsible inside multiple form doesn't work
Closed, ResolvedPublic

Description

I defined a form like this using the mw-collapsible capability to hide 2 of the form fields in the multiple occurring form:

{{{for template|Rating|label=Ratings for this book|multiple}}}
'''Username:''' {{{field|Rating username|size=20|default=current user|mandatory|values from namespace=User|remote autocompletion}}}
<div class="mw-collapsible mw-collapsed">
'''Rating:''' {{{field|Rating|mandatory|input type=dropdown|property=Has rating|values=1.0,1.5,2.0,2.5,3.0,3.5,4.0,4.5,5.0}}}<br/>
'''Blurb:''' (Wikitext allowed) {{{field|Rating blurb|size=80}}}<br/>
</div>
'''Timestamp:''' {{{field|Rating timestamp|default=now|input type=datetime|mandatory|restricted}}}<br/>
{{{end template}}}

This will work fine for already created form instances. However, when you add a new instance of the form it will display as collapsed and hitting [Expand] doesn't work.

I would guess that jQuery has to be notified that a new collapsible entity exists when it is added to the page?


Version: unspecified
Severity: normal

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:13 AM
bzimport set Reference to bz41780.

Just dropping a note that I can confirm this behaviour.

Background: I'm looking for a way to arrange the options available in multiple-instance forms in such a way that they do not overwhelm the editor. (Multiple rows of HeaderTabs under a single tab would be a great alternative, but HeaderTabs does not (yet) handle that sort of thing. Another thing I've considered is multiple instance templates within multiple instance templates but that does not work either.)

Change 661927 had a related patch set uploaded (by Yaron Koren; owner: Yaron Koren):
[mediawiki/extensions/PageForms@master] Add handling of mw-collapsible class to new template instances

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

Change 661927 merged by jenkins-bot:
[mediawiki/extensions/PageForms@master] Add handling of mw-collapsible class to new template instances

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

Yaron_Koren claimed this task.
Yaron_Koren subscribed.

Excited to finally fix this eight-year-old bug!