mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-11-30 19:04:19 +00:00
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:
parent
6ee3f05104
commit
4d4e86ecb2
|
@ -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' );
|
||||
|
|
|
@ -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 ) {
|
||||
|
|
Loading…
Reference in a new issue