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 5fd28c82e4fba238f98a3217d63ec7e928719c70 Author: Daniel Gruno <[email protected]> AuthorDate: Sun Nov 21 17:59:10 2021 +0100 use compact mode if set --- webui/js/source/listview-flat.js | 15 ++++++++------- webui/js/source/listview-threaded.js | 12 +++++++----- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/webui/js/source/listview-flat.js b/webui/js/source/listview-flat.js index ad42154..ad02e34 100644 --- a/webui/js/source/listview-flat.js +++ b/webui/js/source/listview-flat.js @@ -23,7 +23,7 @@ function calc_per_page() { html.clientHeight, html.scrollHeight); let width = Math.max(body.scrollWidth, html.clientWidth, html.scrollWidth); - let email_h = 40; + let email_h = G_current_listmode_compact ? 24 : 40; if (width < 600) { console.log("Using narrow view, halving emails per page..."); email_h = 80; @@ -68,7 +68,7 @@ function listview_flat_element(eml, idx) { }); let element = new HTML('div', { - class: "listview_email_flat" + class: G_current_listmode_compact ? "listview_email_compact" : "listview_email_flat" }, " "); let date = new Date(eml.epoch * 1000.0); let now = new Date(); @@ -101,11 +101,12 @@ function listview_flat_element(eml, idx) { class: 'listview_email_subject email_unread' }, suba); as.inject(subject); - - let body = new HTML('div', { - class: 'listview_email_body' - }, eml.body); - as.inject(body); + if (!G_current_listmode_compact) { // No body in compact mode + let body = new HTML('div', { + class: 'listview_email_body' + }, eml.body); + as.inject(body); + } element.inject(as); diff --git a/webui/js/source/listview-threaded.js b/webui/js/source/listview-threaded.js index 19363a1..26c6464 100644 --- a/webui/js/source/listview-threaded.js +++ b/webui/js/source/listview-threaded.js @@ -111,7 +111,7 @@ function listview_threaded_element(thread, idx) { }); let element = new HTML('div', { - class: "listview_email_flat" + class: G_current_listmode_compact ? "listview_email_compact" : "listview_email_flat" }, " "); let date = new Date(eml.epoch * 1000.0); let now = new Date(); @@ -162,10 +162,12 @@ function listview_threaded_element(thread, idx) { }, suba); as.inject(subject); - let body = new HTML('div', { - class: 'listview_email_body' - }, eml.body); - as.inject(body); + if (!G_current_listmode_compact) { // No body teaser in compact mode + let body = new HTML('div', { + class: 'listview_email_body' + }, eml.body); + as.inject(body); + } element.inject(as);
