From: Andrew Dolgov Date: Thu, 5 Feb 2009 19:34:56 +0000 (+0300) Subject: offline: toggleCollapseCat() update status in local db X-Git-Tag: 1.3.1~76 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=c26aa9f0e129547abbb445e4273cdec14d6f0228;p=tt-rss.git offline: toggleCollapseCat() update status in local db --- 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); + } +}