diff options
| author | Roy Wellington Ⅳ <cactus_hugged@yahoo.com> | 2018-10-16 22:15:27 -0700 |
|---|---|---|
| committer | Roy Wellington Ⅳ <cactus_hugged@yahoo.com> | 2018-10-16 22:15:27 -0700 |
| commit | cbe98ec803c023deb6d200b6761acd7c7d73254c (patch) | |
| tree | adad0b938710cbecfbe49aa5073a8578b7136927 | |
| parent | 8362aa2178959186c09899ca173ffb296fb3445e (diff) | |
| download | rust-cbe98ec803c023deb6d200b6761acd7c7d73254c.tar.gz rust-cbe98ec803c023deb6d200b6761acd7c7d73254c.zip | |
Move usableLocalStorage() above functions that make use of it
| -rw-r--r-- | src/librustdoc/html/static/storage.js | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/librustdoc/html/static/storage.js b/src/librustdoc/html/static/storage.js index 206b3128eb3..e10e330402f 100644 --- a/src/librustdoc/html/static/storage.js +++ b/src/librustdoc/html/static/storage.js @@ -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"; |
