I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Unverified Commit 981c5e38 authored by zzz's avatar zzz
Browse files

i2psnark: Don't js-reload CSS on first click

parent 393ee71a
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
// a public domain is not usable. // a public domain is not usable.
var oldTheme = "ubergine"; var oldTheme = "ubergine";
var change = false;
function swapStyleSheet(theme) { function swapStyleSheet(theme) {
// https://stackoverflow.com/questions/14292997/changing-style-sheet-javascript // https://stackoverflow.com/questions/14292997/changing-style-sheet-javascript
...@@ -18,7 +19,12 @@ function initThemeSwitcher() { ...@@ -18,7 +19,12 @@ function initThemeSwitcher() {
} }
oldtheme = theme.value; oldtheme = theme.value;
theme.onclick = function() { theme.onclick = function() {
swapStyleSheet(theme.value); if (change) {
swapStyleSheet(theme.value);
} else {
// skip the first click to avoid the flash
change = true;
}
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment