Add support for opening details sections in jQuery mode #546
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a simple PR to open all details sections in jQuery mode. It supports recent ZIMs that use the details-summary schema to open and close sections in a document. In browsers that support the details-summary elements, the sections remain closed because the piece of included JavaScript in the ZIM that opens them is not able to run in jQuery mode. This PR adds the
open
attribute to all unopeneddetails
elements, and does it by adding a simple query and test to our existing routine for opening all sections. The PR creates consistency of approach with previous ZIM types.We can consider adding logic here to open all details sections only if the screen size is larger than mobile width. Personally I prefer to start with all sections open even in mobile, and as a user I would like an option to override automatic decisions taken by the browser that I would find annoying (!). Therefore, if we implement opening all sections only in desktop mode, I'd vote for adding a simple configuration option "Always open all sections in Wikimedia articles".