Skip to content

Commit

Permalink
Fix blink when main theme is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Mar 12, 2018
1 parent 883e746 commit 366ee85
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/librustdoc/html/static/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 366ee85

Please sign in to comment.