Merge "Rename setRepoInlineStyle to setInlineStyle"

This commit is contained in:
jenkins-bot 2014-04-07 09:28:09 +00:00 committed by Gerrit Code Review
commit 7b79d7a073
4 changed files with 8 additions and 8 deletions

View file

@ -104,7 +104,7 @@
* @param {string} key some name to identify the style
* @param {string|null} style a CSS snippet (set to null to delete the given style)
*/
EP.setRepoInlineStyle = function ( key, style ) {
EP.setInlineStyle = function ( key, style ) {
if ( !this.$inlineStyles ) {
this.$inlineStyles = [];

View file

@ -420,13 +420,13 @@
// This horror exists because the CSS uses a :before pseudo-class to
// define the repo icon. This is the only way to override it.
if ( favIcon ) {
this.setRepoInlineStyle( 'repoDisplay',
this.setInlineStyle( 'repoDisplay',
'.mw-mmv-image-links li.mw-mmv-repo-li:before {' +
'background-image: url("' + favIcon + '");' +
'}'
);
} else {
this.setRepoInlineStyle( 'repoDisplay', null );
this.setInlineStyle( 'repoDisplay', null );
}
this.$repoLi.removeClass( 'empty' );

View file

@ -208,7 +208,7 @@
this.buttons.$descriptionPage.addClass( 'mw-mmv-stripe-button-commons' );
} else {
this.buttons.$descriptionPage.addClass( 'mw-mmv-stripe-button-dynamic' );
this.setRepoInlineStyle( 'stripe-button-description-page',
this.setInlineStyle( 'stripe-button-description-page',
'.mw-mmv-stripe-button-dynamic:before {' +
'background-image: url("' + repoInfo.favIcon + '");' +
'}'
@ -229,7 +229,7 @@
this.buttons.$descriptionPage.attr( { href: null, title: null, 'original-title': null } )
.removeClass( 'mw-mmv-stripe-button-dynamic mw-mmv-stripe-button-commons' );
$( '.mw-mmv-stripe-button-dynamic-before' ).remove();
this.setRepoInlineStyle( 'stripe-button-description-page', null );
this.setInlineStyle( 'stripe-button-description-page', null );
}
};

View file

@ -15,17 +15,17 @@
$( document ).trigger( new $.Event( 'mmv-foo' ) );
} );
QUnit.test( 'setRepoInlineStyle()', 3, function ( assert ) {
QUnit.test( 'setInlineStyle()', 3, function ( assert ) {
var element = new mw.mmv.ui.Element( $( '<div>' ) ),
$testDiv = $( '<div id="mmv-testdiv">!!!</div>' ).appendTo( '#qunit-fixture' );
assert.ok( $testDiv.is( ':visible' ), 'Test div is visible' );
element.setRepoInlineStyle( 'test', '#mmv-testdiv { display: none; }' );
element.setInlineStyle( 'test', '#mmv-testdiv { display: none; }' );
assert.ok( !$testDiv.is( ':visible' ), 'Test div is hidden by inline style' );
element.setRepoInlineStyle( 'test', null );
element.setInlineStyle( 'test', null );
assert.ok( $testDiv.is( ':visible' ), 'Test div is visible again' );
} );