Fix blink when main theme is selected
This commit is contained in:
parent
883e74645d
commit
366ee8518f
1 changed files with 5 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue