Merge "Use a.mw-file-description to find thumbs"

This commit is contained in:
jenkins-bot 2023-10-12 02:04:49 +00:00 committed by Gerrit Code Review
commit 8161b14ea0
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 ) {