toggle_cdm_expanded: use xhrPost

This commit is contained in:
Andrew Dolgov 2018-12-01 01:18:32 +03:00
parent 5aa9c60494
commit c155a9e1ef
1 changed files with 4 additions and 7 deletions

View File

@ -509,14 +509,11 @@ function init_hotkey_actions() {
notify_progress("Loading, please wait..."); notify_progress("Loading, please wait...");
const value = getInitParam("cdm_expanded") ? "false" : "true"; const value = getInitParam("cdm_expanded") ? "false" : "true";
const query = "?op=rpc&method=setpref&key=CDM_EXPANDED&value=" + value;
new Ajax.Request("backend.php", { xhrPost("backend.php", { op: "rpc", method: "setpref", key: "CDM_EXPANDED", value: value }, () => {
parameters: query, setInitParam("cdm_expanded", !getInitParam("cdm_expanded"));
onComplete: function(transport) { viewCurrentFeed();
setInitParam("cdm_expanded", !getInitParam("cdm_expanded")); });
viewCurrentFeed();
} });
}; };
} }