From 807ea755e0bddb814f5c55bdfa5321ce144fe816 Mon Sep 17 00:00:00 2001 From: maTh Date: Sun, 15 May 2022 21:52:52 +0200 Subject: fix preview (#4291) * fix * Update extra.js * reorga the scripts * Update extra.js * Several fixes https://github.com/FreshRSS/FreshRSS/pull/4291#issuecomment-1125472321 * More fixes * Cleaning * fix pr 4291 * Reorganise some script functions * Remove unused popup-txt And associated function openPopupWithMessage * Fix archiving categories https://github.com/FreshRSS/FreshRSS/pull/4291#issuecomment-1126924602 * Fix stats https://github.com/FreshRSS/FreshRSS/pull/4291#issuecomment-1126983134 * Fix direct subscription E.g. http://localhost/i/?c=subscription&id=735 * Fix subscription add https://github.com/FreshRSS/FreshRSS/pull/4291#issuecomment-1126991621 Co-authored-by: Alexandre Alapetite --- p/scripts/preview.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'p/scripts/preview.js') diff --git a/p/scripts/preview.js b/p/scripts/preview.js index 48675d42c..e27645f23 100644 --- a/p/scripts/preview.js +++ b/p/scripts/preview.js @@ -18,6 +18,9 @@ function update_ui() { function init_afterDOM() { rendered_node = document.getElementById('freshrss_rendered'); + if (!rendered_node) { + return; + } rendered_view = document.getElementById('freshrss_rendered_view'); raw_node = document.getElementById('freshrss_raw'); @@ -32,7 +35,7 @@ if (document.readyState && document.readyState !== 'loading') { } else { document.addEventListener('DOMContentLoaded', function () { if (window.console) { - console.log('FreshRSS waiting for DOMContentLoaded…'); + console.log('FreshRSS preview waiting for DOMContentLoaded…'); } init_afterDOM(); }, false); -- cgit v1.2.3