From 5ae8f858a96c5cee498202ac372fe02aba9198b1 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 11 Nov 2010 12:19:28 +0300 Subject: [PATCH] fix frontend not knowing about always expanded cdm --- functions.php | 2 +- tt-rss.js | 15 +++++---------- viewfeed.js | 4 ++-- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/functions.php b/functions.php index 0eb1987b..da10098e 100644 --- a/functions.php +++ b/functions.php @@ -3180,8 +3180,8 @@ $data = array(); $data['num_feeds'] = (int) $num_feeds; - $data['last_article_id'] = getLastArticleId($link); + $data['cdm_expanded'] = get_pref($link, 'CDM_EXPANDED'); if (ENABLE_UPDATE_DAEMON) { diff --git a/tt-rss.js b/tt-rss.js index 841d4b33..917196ba 100644 --- a/tt-rss.js +++ b/tt-rss.js @@ -556,10 +556,6 @@ function parse_runtime_info(elem) { // console.log("RI: " + k + " => " + v); - if (k == "num_feeds" || k == "last_article_id") { - init_params[k] = v; - } - if (k == "new_version_available") { var icon = $("newVersionIcon"); if (icon) { @@ -569,24 +565,23 @@ function parse_runtime_info(elem) { icon.style.display = "none"; } } + return; } var error_flag; if (k == "daemon_is_running" && v != 1) { notify_error("Update daemon is not running.", true); - error_flag = true; + return; } if (k == "daemon_stamp_ok" && v != 1) { notify_error("Update daemon is not updating feeds.", true); - error_flag = true; + return; } - if (!error_flag) { - notify(''); - } - + init_params[k] = v; + notify(''); } } diff --git a/viewfeed.js b/viewfeed.js index 4dacb200..0551de9a 100644 --- a/viewfeed.js +++ b/viewfeed.js @@ -164,7 +164,7 @@ function headlines_callback2(transport, feed_cur_page) { } else { if (headlines) { if (headlines_count > 0) { - console.warn("adding some more headlines..."); + console.log("adding some more headlines..."); var c = $("headlinesList"); @@ -2088,7 +2088,7 @@ function cdmExpandArticle(id) { var old_offset = $("RROW-" + id).offsetTop; - if (active_post_id && elem) { + if (active_post_id && elem && !getInitParam("cdm_expanded")) { Element.hide(elem); Element.show("CEXC-" + active_post_id); } -- 2.39.5