From a39557451604ba1ad4558f8283f1a13ca76ba5ba Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 25 Feb 2022 18:45:00 +0300 Subject: [PATCH] actions dropdown: add context-sensitive UI layout labels --- index.php | 29 ++++++++++++++++++++++++----- js/App.js | 25 +++++++++++++++++++------ 2 files changed, 43 insertions(+), 11 deletions(-) diff --git a/index.php b/index.php index 37a3253b9..b1f3274f3 100644 --- a/index.php +++ b/index.php @@ -239,10 +239,26 @@ menu
@@ -254,10 +270,13 @@
-
+
+
-
+
+
+
{ + this.setInitParam("cdm_expanded", !this.getInitParam("cdm_expanded")); + Headlines.renderAgain(); + }); + } else { + alert(__("This function is only available in combined mode.")); + } + }, getActionByHotkeySequence: function(sequence) { const hotkeys_map = this.getInitParam("hotkeys"); @@ -1236,12 +1251,7 @@ const App = { App.setCombinedMode(!App.isCombinedMode()); }; this.hotkey_actions["toggle_cdm_expanded"] = () => { - const value = this.getInitParam("cdm_expanded") ? "false" : "true"; - - xhr.post("backend.php", {op: "rpc", method: "setpref", key: "CDM_EXPANDED", value: value}, () => { - this.setInitParam("cdm_expanded", !this.getInitParam("cdm_expanded")); - Headlines.renderAgain(); - }); + App.setExpandedMode(!App.isExpandedMode()); }; this.hotkey_actions["article_span_grid"] = () => { Article.cdmToggleGridSpan(Article.getActive()); @@ -1307,6 +1317,9 @@ const App = { case "qmcToggleCombined": App.setCombinedMode(!App.isCombinedMode()); break; + case "qmcToggleExpanded": + App.setExpandedMode(!App.isExpandedMode()); + break; case "qmcHKhelp": this.hotkeyHelp() break;