Steps to replicate the issue (include links if applicable):
- Visit https://en.m.wikipedia.beta.wmflabs.org/wiki/A_gallery_page#Foo
- Click gallery image
What happens?:
I navigate to the file page
What should have happened instead?:
The mobile media viewer should have opened
Other information (browser name/version, screenshots, etc.):
This happens because the gallery is initialized with JavaScript after the media viewer is wired up. We could either adapt mobile to support eligible links added via JavaScript or introduce a hook that wires up the gallery.
` // currently $( 'a.image' ).on( 'click', loadMediaViewer) // possible $( document ).on( 'click', 'a.image', loadMediaViewer)