Rollup merge of #48831 - GuillaumeGomez:fix-theme-blink, r=QuietMisdreavus

Fix blink when main theme is selected

r? @QuietMisdreavus
This commit is contained in:
kennytm 2018-03-14 16:29:43 +08:00
commit c65ee94365
No known key found for this signature in database
GPG key ID: FEF6C8051D0E013C

View file

@ -44,8 +44,12 @@ function switchTheme(styleElem, mainStyleElem, newTheme) {
var fullBasicCss = "rustdoc" + resourcesSuffix + ".css";
var fullNewTheme = newTheme + resourcesSuffix + ".css";
var newHref = mainStyleElem.href.replace(fullBasicCss, fullNewTheme);
var found = false;
if (styleElem.href === newHref) {
return;
}
var found = false;
if (savedHref.length === 0) {
onEach(document.getElementsByTagName("link"), function(el) {
savedHref.push(el.href);