Don't use JavaScript to style first sidebar portlet

We were adding a .first CSS class to the portlet from JavaScript
instead of just using a smarter selector, which caused the incorrectly
styled portlet to visibly flash sometimes.

This was only useful for IE 6 (even IE 7 supports the sibling selector
'+', which we can use here), and we don't serve JavaScript to it
anymore. It would be neater to use ':first-of-type', but that's not as
widely supported.

Bug: T89542
Change-Id: I1904b3899c43bca52a6c996b8ce08c8bdf764aa0
This commit is contained in:
Bartosz Dziewoński 2015-02-14 12:25:17 +01:00 committed by Ori.livneh
parent 46c2ae820a
commit 16e16eb075
2 changed files with 10 additions and 14 deletions

View File

@ -129,16 +129,17 @@ div#mw-panel {
}
}
}
}
&.first {
background-image: none;
margin-top: 0;
h3 {
display: none;
}
div.body {
margin-left: 0.5em;
}
/* First sidebar portlet. Not using :first-of-type for IE<=8 support. */
#p-logo + div.portal {
background-image: none;
margin-top: 0;
h3 {
display: none;
}
div.body {
margin-left: 0.5em;
}
}
}

View File

@ -33,11 +33,6 @@ jQuery( function ( $ ) {
.attr( 'tabindex', '-1' );
} );
/**
* Sidebar
*/
$( '#mw-panel > .portal:first' ).addClass( 'first' );
/**
* Collapsible tabs
*/