You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by hu...@apache.org on 2021/11/21 17:00:00 UTC

[incubator-ponymail-foal] 05/08: add in compact mode get/set

This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git

commit 0fee78e1b9517683627da3c5582b21474825db2f
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Sun Nov 21 17:58:53 2021 +0100

    add in compact mode get/set
---
 webui/js/source/preferences.js | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/webui/js/source/preferences.js b/webui/js/source/preferences.js
index 5ac8ef8..0789b44 100644
--- a/webui/js/source/preferences.js
+++ b/webui/js/source/preferences.js
@@ -68,6 +68,12 @@ function init_preferences(state, json) {
         dmtr.checked = (G_current_listmode == 'treeview');
     }
 
+    // Compact list view
+    let dmc = document.getElementById('display_mode_compact');
+    if (dmc) {
+        dmc.checked = G_current_listmode_compact;
+    }
+
 
 
     if (G_ponymail_preferences.login && G_ponymail_preferences.login.credentials) {
@@ -137,8 +143,11 @@ function save_preferences() {
 }
 
 
-function set_theme(theme) {
+function set_theme(theme, compact_mode) {
     G_current_listmode = theme;
+    if (compact_mode !== undefined) {
+        G_current_listmode_compact = compact_mode;
+    }
     renderListView(G_current_state, G_current_json);
     save_preferences();
 }