Spaces:
Running
Running
Julien Chaumond
commited on
Commit
·
c6642be
1
Parent(s):
c80a031
local storage keep state of debug
Browse files- js-src/zController.ts +6 -2
js-src/zController.ts
CHANGED
|
@@ -19,6 +19,8 @@ const toggleDebug = () => {
|
|
| 19 |
(<any>icons).forEach((icon) => {
|
| 20 |
icon.classList.toggle('hide');
|
| 21 |
});
|
|
|
|
|
|
|
| 22 |
};
|
| 23 |
|
| 24 |
const coref = new Coref(ENDPOINT, {
|
|
@@ -79,8 +81,10 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
| 79 |
toggleDebug();
|
| 80 |
});
|
| 81 |
|
| 82 |
-
// Turn on debug mode by default:
|
| 83 |
-
|
|
|
|
|
|
|
| 84 |
});
|
| 85 |
|
| 86 |
|
|
|
|
| 19 |
(<any>icons).forEach((icon) => {
|
| 20 |
icon.classList.toggle('hide');
|
| 21 |
});
|
| 22 |
+
/// local storage
|
| 23 |
+
window.localStorage.setItem('debug', document.body.classList.contains('debug').toString());
|
| 24 |
};
|
| 25 |
|
| 26 |
const coref = new Coref(ENDPOINT, {
|
|
|
|
| 81 |
toggleDebug();
|
| 82 |
});
|
| 83 |
|
| 84 |
+
// Turn on debug mode by default, unless `false` is stored in local storage:
|
| 85 |
+
if (window.localStorage.getItem('debug') !== 'false') {
|
| 86 |
+
toggleDebug();
|
| 87 |
+
}
|
| 88 |
});
|
| 89 |
|
| 90 |
|