From c26aa9f0e129547abbb445e4273cdec14d6f0228 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 5 Feb 2009 22:34:56 +0300 Subject: [PATCH] offline: toggleCollapseCat() update status in local db --- feedlist.js | 2 ++ offline.js | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/feedlist.js b/feedlist.js index cd1d8b20..740ecdbc 100644 --- a/feedlist.js +++ b/feedlist.js @@ -400,6 +400,8 @@ function toggleCollapseCat(cat) { new Ajax.Request("backend.php?op=feeds&subop=collapse&cid=" + param_escape(cat)); + local_collapse_cat(cat); + } catch (e) { exception_error("toggleCollapseCat", e); } diff --git a/offline.js b/offline.js index fd3e7ef7..b06c5fb5 100644 --- a/offline.js +++ b/offline.js @@ -830,3 +830,13 @@ function gotoOnline() { window.location.href = "tt-rss.php"; } +function local_collapse_cat(id) { + try { + if (db) { + db.execute("UPDATE categories SET collapsed = NOT collapsed WHERE id = ?", + [id]); + } + } catch (e) { + exception_error("local_collapse_cat", e); + } +} -- 2.39.5