From c155a9e1ef7d91ca31f11737b8f6dc72c29d8e91 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 1 Dec 2018 01:18:32 +0300 Subject: toggle_cdm_expanded: use xhrPost --- js/tt-rss.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'js/tt-rss.js') diff --git a/js/tt-rss.js b/js/tt-rss.js index e29580c8a..099c50b54 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -509,14 +509,11 @@ function init_hotkey_actions() { notify_progress("Loading, please wait..."); const value = getInitParam("cdm_expanded") ? "false" : "true"; - const query = "?op=rpc&method=setpref&key=CDM_EXPANDED&value=" + value; - new Ajax.Request("backend.php", { - parameters: query, - onComplete: function(transport) { - setInitParam("cdm_expanded", !getInitParam("cdm_expanded")); - viewCurrentFeed(); - } }); + xhrPost("backend.php", { op: "rpc", method: "setpref", key: "CDM_EXPANDED", value: value }, () => { + setInitParam("cdm_expanded", !getInitParam("cdm_expanded")); + viewCurrentFeed(); + }); }; } -- cgit v1.2.3