fix light mode

This commit is contained in:
Adrien Beudin 2016-05-27 12:06:46 +02:00
parent b7edcfcb08
commit b02406c606
3 changed files with 7 additions and 6 deletions

View File

@ -15,7 +15,6 @@ DEFAULTS = {
"share": False, "share": False,
"settings": {}, "settings": {},
"show_date": True, "show_date": True,
"light_mode": False,
} }
SETTINGS = { SETTINGS = {
@ -328,7 +327,7 @@ def main():
link=gallery link=gallery
).encode("Utf-8")) ).encode("Utf-8"))
if settings["settings"].get("light_mode", True): if settings["settings"].get("light_mode"):
print "light mode enable" print "light mode enable"
if not os.path.exists(os.path.join("build", gallery, "light")): if not os.path.exists(os.path.join("build", gallery, "light")):
os.makedirs(os.path.join("build", gallery, "light")) os.makedirs(os.path.join("build", gallery, "light"))

View File

@ -72,6 +72,7 @@ $(function() {
}); });
}); });
{% if settings.settings.light_mode %}
var slowLoad = window.setTimeout( function() { var slowLoad = window.setTimeout( function() {
var html_node = document.getElementsByTagName('html')[0]; var html_node = document.getElementsByTagName('html')[0];
var div = document.createElement('div'); var div = document.createElement('div');
@ -101,7 +102,7 @@ var slowLoad = window.setTimeout( function() {
div.appendChild(dismiss_container); div.appendChild(dismiss_container);
html_node.appendChild(div); html_node.appendChild(div);
}, 10 ); }, 1000 );
window.addEventListener( 'load', function() { window.addEventListener( 'load', function() {
try { try {
@ -112,6 +113,7 @@ window.addEventListener( 'load', function() {
} }
}); });
{% endif %}
</script> </script>

View File

@ -77,7 +77,7 @@ $(function() {
}); });
}); });
{% if settings.settings.light_mode %}
var slowLoad = window.setTimeout( function() { var slowLoad = window.setTimeout( function() {
var html_node = document.getElementsByTagName('html')[0]; var html_node = document.getElementsByTagName('html')[0];
var div = document.createElement('div'); var div = document.createElement('div');
@ -107,7 +107,7 @@ var slowLoad = window.setTimeout( function() {
div.appendChild(dismiss_container); div.appendChild(dismiss_container);
html_node.appendChild(div); html_node.appendChild(div);
}, 10 ); }, 1000 );
window.addEventListener( 'load', function() { window.addEventListener( 'load', function() {
try { try {
@ -118,7 +118,7 @@ window.addEventListener( 'load', function() {
} }
}); });
{% endif %}
$(".button-collapse").sideNav(); $(".button-collapse").sideNav();
</script> </script>