From 8bc8edecb51bab064dee62176f6bc00727656cd0 Mon Sep 17 00:00:00 2001 From: Jaifroid Date: Thu, 6 Dec 2018 17:06:21 +0000 Subject: [PATCH] Remove all alerts on new page load Former-commit-id: 73120a2960f2f8b368f2931295c22eae447cf652 [formerly 9cf30ad3bc17c4de6602734bfc7e4b770392d30d] Former-commit-id: 90c5c4d1b6e8e1a1f6a8bb57ab135d75a77fc25a --- www/js/app.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/www/js/app.js b/www/js/app.js index 10fb0c02..1c46cfd4 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -2001,9 +2001,11 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies', 'q', 'module' * @param {String} htmlArticle */ function displayArticleInForm(dirEntry, htmlArticle) { - // Remove any download alerts hanging on from previous article - var downloadAlert = document.getElementById('downloadAlert'); - if (downloadAlert) downloadAlert.parentElement.removeChild(downloadAlert); + // Remove any download alerts and active content hanging on from previous article + ['activeContent', 'downloadAlert'].forEach(function (id) { + var rmv = document.getElementById(id); + if (rmv) rmv.parentElement.removeChild(rmv); + }); //@BUG WORKAROUND for Kiwix-JS-Windows #18 htmlArticle = htmlArticle.replace(/(]*?\bhref\s*=\s*["'])(s\/[\s\S]+(?!\.css))(["'])/gi, "$1../-/$2.css$3");