From d3a30067fa96b5486a9d1c4cc90496af4c93d92d Mon Sep 17 00:00:00 2001 From: maximstewart Date: Sat, 13 Feb 2021 05:33:17 -0600 Subject: [PATCH] Small js changes --- src/core/config.py | 2 +- src/core/static/js/events.js | 25 ++++++++++++----------- src/core/templates/modals/file-modal.html | 5 +---- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/src/core/config.py b/src/core/config.py index 19362a8..6a7d29a 100644 --- a/src/core/config.py +++ b/src/core/config.py @@ -18,7 +18,7 @@ class Config(object): TITLE = APP_NAME DEBUG = False TESTING = False - THREADED =True + THREADED = True SECRET_KEY = secrets.token_hex(32) PERMANENT_SESSION_LIFETIME = timedelta(days = 7).total_seconds() diff --git a/src/core/static/js/events.js b/src/core/static/js/events.js index de003d1..2389a83 100644 --- a/src/core/static/js/events.js +++ b/src/core/static/js/events.js @@ -3,21 +3,22 @@ window.onload = (eve) => { } document.body.onload = (eve) => { - getFavesAjax(); - reloadDirectory(); if (window.self !== window.top) { - setTimeout(function () { - let elm = document.getElementById("bg"); - elm.parentElement.removeChild(elm); + let elm = document.getElementById("bg"); + elm.parentElement.removeChild(elm); - // Stylesheet for iframe views - let link = document.createElement("link"); - link.href = formatURL("static/css/iframe.css"); - link.type = "text/css"; - link.rel = "stylesheet"; - document.getElementsByTagName("head")[0].appendChild(link); - }, 500); + // Stylesheet for iframe views + let link = document.createElement("link"); + link.href = "static/css/iframe.css"; + link.type = "text/css"; + link.rel = "stylesheet"; + document.getElementsByTagName("head")[0].appendChild(link); } + + setTimeout(function () { + getFavesAjax(); + reloadDirectory(); + }, 200); } diff --git a/src/core/templates/modals/file-modal.html b/src/core/templates/modals/file-modal.html index b07790e..78c8983 100644 --- a/src/core/templates/modals/file-modal.html +++ b/src/core/templates/modals/file-modal.html @@ -5,9 +5,7 @@