diff --git a/resources/mmv/mmv.js b/resources/mmv/mmv.js index f57f63a0c..9063c5092 100644 --- a/resources/mmv/mmv.js +++ b/resources/mmv/mmv.js @@ -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 ); diff --git a/tests/qunit/mmv/mmv.bootstrap.test.js b/tests/qunit/mmv/mmv.bootstrap.test.js index 1dbc945fb..62b8cd0e2 100644 --- a/tests/qunit/mmv/mmv.bootstrap.test.js +++ b/tests/qunit/mmv/mmv.bootstrap.test.js @@ -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.' ); } );