Move usableLocalStorage() above functions that make use of it
This commit is contained in:
parent
8362aa2178
commit
cbe98ec803
@ -26,21 +26,6 @@ function onEach(arr, func) {
|
||||
return false;
|
||||
}
|
||||
|
||||
function updateLocalStorage(name, value) {
|
||||
if (usableLocalStorage()) {
|
||||
localStorage[name] = value;
|
||||
} else {
|
||||
// No Web Storage support so we do nothing
|
||||
}
|
||||
}
|
||||
|
||||
function getCurrentValue(name) {
|
||||
if (usableLocalStorage() && localStorage[name] !== undefined) {
|
||||
return localStorage[name];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function usableLocalStorage() {
|
||||
// Check if the browser supports localStorage at all:
|
||||
if (typeof(Storage) === "undefined") {
|
||||
@ -59,6 +44,21 @@ function usableLocalStorage() {
|
||||
return true;
|
||||
}
|
||||
|
||||
function updateLocalStorage(name, value) {
|
||||
if (usableLocalStorage()) {
|
||||
localStorage[name] = value;
|
||||
} else {
|
||||
// No Web Storage support so we do nothing
|
||||
}
|
||||
}
|
||||
|
||||
function getCurrentValue(name) {
|
||||
if (usableLocalStorage() && localStorage[name] !== undefined) {
|
||||
return localStorage[name];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function switchTheme(styleElem, mainStyleElem, newTheme) {
|
||||
var fullBasicCss = "rustdoc" + resourcesSuffix + ".css";
|
||||
var fullNewTheme = newTheme + resourcesSuffix + ".css";
|
||||
|
Loading…
Reference in New Issue
Block a user