Remove all alerts on new page load

Former-commit-id: 73120a2960f2f8b368f2931295c22eae447cf652 [formerly 9cf30ad3bc17c4de6602734bfc7e4b770392d30d]
Former-commit-id: 90c5c4d1b6e8e1a1f6a8bb57ab135d75a77fc25a
This commit is contained in:
Jaifroid 2018-12-06 17:06:21 +00:00
parent e0c60063fb
commit 8bc8edecb5

View File

@ -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(/(<link\s+[^>]*?\bhref\s*=\s*["'])(s\/[\s\S]+(?!\.css))(["'])/gi, "$1../-/$2.css$3");