mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-09-24 02:39:37 +00:00
Do not clone CSS class names as well
What MultiMediaViewer does is re-using the small thumbnail <img> that is already present on the page, cloning it, blowing the size up, and using it as a "placeholder thumbnail". The moment the bigger image finished loading, it replaces the placeholder. The issue here is that the cloning includes class names like the <img class="thumbimage"> on every [[File:…|thumb]] image. This shows a gray border. The cloned DOM node in MultiMediaViewer shows this gray border around the placeholder for a short time. This can be distracting. Change-Id: Ie83427fab478b6568731b9a0b1f7dbbcc6d5b0fb
This commit is contained in:
parent
8251aa89b7
commit
26fbcd6095
|
@ -275,9 +275,10 @@
|
|||
// know what size it should be. We still assign it to allow for
|
||||
// size calculations in getCurrentImageWidths, which needs to know
|
||||
// the aspect ratio
|
||||
$initialImage.hide();
|
||||
$initialImage.addClass( 'mw-mmv-placeholder-image' );
|
||||
$initialImage.addClass( image.filePageTitle.ext.toLowerCase() );
|
||||
$initialImage.hide()
|
||||
.removeAttr( 'style' )
|
||||
.removeClass()
|
||||
.addClass( 'mw-mmv-placeholder-image ' + image.filePageTitle.ext.toLowerCase() );
|
||||
|
||||
this.ui.canvas.set( image, $initialImage );
|
||||
|
||||
|
|
|
@ -550,16 +550,13 @@
|
|||
$container.addClass( 'metadata' );
|
||||
assert.strictEqual( bootstrap.isAllowedThumb( $thumb ), false, 'Image in a metadata container is disallowed.' );
|
||||
|
||||
$container.prop( 'class', '' );
|
||||
$container.addClass( 'noviewer' );
|
||||
$container.removeClass().addClass( 'noviewer' );
|
||||
assert.strictEqual( bootstrap.isAllowedThumb( $thumb ), false, 'Image in a noviewer container is disallowed.' );
|
||||
|
||||
$container.prop( 'class', '' );
|
||||
$container.addClass( 'noarticletext' );
|
||||
$container.removeClass().addClass( 'noarticletext' );
|
||||
assert.strictEqual( bootstrap.isAllowedThumb( $thumb ), false, 'Image in an empty article is disallowed.' );
|
||||
|
||||
$container.prop( 'class', '' );
|
||||
$thumb.addClass( 'noviewer' );
|
||||
$container.removeClass().addClass( 'noviewer' );
|
||||
assert.strictEqual( bootstrap.isAllowedThumb( $thumb ), false, 'Image with a noviewer class is disallowed.' );
|
||||
} );
|
||||
|
||||
|
|
Loading…
Reference in a new issue