Use a.mw-file-description to find thumbs

a.thumb is no longer outputted when $wgParserEnableLegacyMediaDOM is
false (fdd8f864 ), use the new class from 350721cc

Bug: T348275
Change-Id: I5ec67accab4e1cbfa90544087750016e1baab85d
This commit is contained in:
Umherirrender 2023-10-05 21:16:50 +02:00
parent 6ee3f05104
commit 4d4e86ecb2
2 changed files with 3 additions and 2 deletions

View file

@ -188,6 +188,7 @@ const HtmlUtils = require( './mmv.HtmlUtils.js' );
this.$thumbs = $content.find(
'.gallery .image img, ' +
'a.image img, ' +
'a.mw-file-description img, ' +
'#file a img'
);
@ -268,7 +269,7 @@ const HtmlUtils = require( './mmv.HtmlUtils.js' );
processThumb( thumb ) {
let title;
const $thumb = $( thumb );
const $link = $thumb.closest( 'a.image' );
const $link = $thumb.closest( 'a.image, a.mw-file-description' );
const $thumbContainer = $link.closest( '.thumb' );
const $enlarge = $thumbContainer.find( '.magnify a' );
const link = $link.prop( 'href' );

View file

@ -31,7 +31,7 @@ module.exports = base;
return;
}
$document.on( 'click.mmv-head', 'a.image', ( e ) => {
$document.on( 'click.mmv-head', 'a.image, a.mw-file-description', ( e ) => {
// Do not interfere with non-left clicks or if modifier keys are pressed.
// Also, make sure we do not get in a loop.
if ( ( e.button !== 0 && e.which !== 1 ) || e.altKey || e.ctrlKey || e.shiftKey || e.metaKey || e.replayed ) {