Added Javascript to hide not working images

This commit is contained in:
PaulStets 2018-04-20 12:47:58 +03:00
parent 8292bda877
commit 2a615480df

View file

@ -73,7 +73,19 @@ public class WikivoyageArticleDialogFragment extends WikivoyageBaseDialogFragmen
" content.style.display = \"block\";" + " content.style.display = \"block\";" +
" }" + " }" +
" });" + " });" +
"}" + "function scrollAnchor(id, title) {" + "}" +
"document.addEventListener(\"DOMContentLoaded\", function(event) {\n" +
" document.querySelectorAll('img').forEach(function(img) {\n" +
" img.onerror = function() {\n" +
" this.style.display = 'none';\n" +
" var caption = img.parentElement.nextElementSibling;\n" +
" if (caption.className == \"thumbnailcaption\") {\n" +
" caption.style.display = 'none';\n" +
" }\n" +
" };\n" +
" })\n" +
"});" +
"function scrollAnchor(id, title) {" +
"openContent(title);" + "openContent(title);" +
"window.location.hash = id;}\n" + "window.location.hash = id;}\n" +
"function openContent(id) {\n" + "function openContent(id) {\n" +