This feature is a necessity for the "Medical cases chart" template in Wikipedia (https://en.wikipedia.org/wiki/Template:Medical_cases_chart) to work properly. The issue is described here: https://en.wikipedia.org/wiki/Template_talk:Medical_cases_chart#"Last_15_days"_bug%3F. In short, the current custom collapsible implementation acts kind of "blindly". If there are two custom toggles that affect two sets of "mw-collapsible"s that partially overlap, we get an "intersection of sets toggling mess". For example, in one "Medical cases chart" template (https://en.wikipedia.org/w/index.php?title=Template:COVID-19_pandemic_data/South_Korea_medical_cases_chart&oldid=976971118), if you press "Aug", with the "Last 15 days" button already highlighted (default), it will expand the August days but collapse the intersection with the already expanded days (creating a gap). What is expected is for it to simply ALSO expand August. Another implication is that it is impossible to add an "All" button as it would just invert whatever is already expanded. I think this current behavior is not useful at all, therefore I implemented a user script (https://en.wikipedia.org/wiki/User:Alexiscoutinho/sandbox.js) which does exactly what the guys there wanted. Since I could not disable the default "makeCollapsible", I had to create an "unmaker" for custom collapsibles. I made a demo in my sandbox (https://en.wikipedia.org/wiki/User:Alexiscoutinho/sandbox + https://en.wikipedia.org/wiki/User:Alexiscoutinho/sandbox.css) to help compare the old and new desired behaviors. The old behavior can still be achieved if the "makeCollapsible" method is called with "options.toggleCustom=false". That user script also does some minor fixes to the existing code. Obviously, only the plugin part of the script + the missing closure and 2 doc comments would be needed if that script was to be implemented as is. This is my first JS project :)
Description
Description
Related Objects
Related Objects
Event Timeline
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 10 2020, 10:57 PM2020-09-10 22:57:35 (UTC+0)
Alexiscoutinho updated the task description. (Show Details)Sep 17 2020, 2:20 AM2020-09-17 02:20:50 (UTC+0)
Alexiscoutinho updated the task description. (Show Details)Sep 22 2020, 9:30 PM2020-09-22 21:30:17 (UTC+0)
Alexiscoutinho updated the task description. (Show Details)Sep 22 2020, 9:34 PM2020-09-22 21:34:15 (UTC+0)