From 6778fc82c8c8c941057257c12ab8ac49a2acc7c6 Mon Sep 17 00:00:00 2001 From: Mossroy Date: Sat, 26 May 2018 23:10:30 +0200 Subject: [PATCH] Avoid white page before displaying article content. Fixes #379 --- www/js/app.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/www/js/app.js b/www/js/app.js index b509cf11..90a23be4 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -824,8 +824,6 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies','abstractFiles * @param {String} htmlArticle */ function displayArticleInForm(dirEntry, htmlArticle) { - $("#readingArticle").hide(); - $("#articleContent").show(); // Scroll the iframe to its top $("#articleContent").contents().scrollTop(0); @@ -856,6 +854,10 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies','abstractFiles articleContent.innerHTML = htmlArticle; // Add any missing classes stripped from the tag if (htmlCSS) articleContent.getElementsByTagName('body')[0].classList.add(htmlCSS); + // Actually display the iframe content + $("#readingArticle").hide(); + $("#articleContent").show(); + // Allow back/forward in browser history pushBrowserHistoryState(dirEntry.namespace + "/" + dirEntry.url); // If the ServiceWorker is not useable, we need to fallback to parse the DOM // to inject images, CSS etc, and replace links with javascript calls