Skip to content

Commit 0acbc14

Browse files
author
Christian Jensen
authored
Increase the vertical space for emails (#18)
The current space (250px) only supports around 10 emails. This adjustment should double it. Adds handle to expand/contract message list as desired. Co-authored-by: Stephen Mitchell
1 parent 5ff0c3f commit 0acbc14

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/mail_panel/static/debug_toolbar/mail/mail_toolbar.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,10 @@
5555

5656
}
5757
#djDebug .djm-mail-toolbar .djm-message-list {
58-
max-height: 250px;
58+
max-height: 500px;
5959
overflow: scroll;
6060
border: 1px solid #d5d6d5;
61+
resize: vertical;
6162
}
6263
#djDebug .djm-mail-toolbar div#djm_message_container {
6364
width:100%;
@@ -130,4 +131,4 @@
130131
width: 15px;
131132
height: 15px;
132133
margin-right: 5px;
133-
}
134+
}

src/mail_panel/static/debug_toolbar/mail/toolbar.mail.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,18 @@ function djmail_load(url, element, callback)
1919

2020
djmail_document_ready(function(){
2121

22-
window.onresize = resize_message;
23-
2422
var $q = document.querySelector.bind(document);
2523
var $qa = document.querySelectorAll.bind(document);
2624

25+
window.onresize = resize_message;
26+
27+
// resize on message list css resize
28+
let observer = new MutationObserver(function(mutations) {
29+
resize_message()
30+
});
31+
let child = $q('.djm-message-list');
32+
observer.observe(child, { attributes: true });
33+
2734
function resize_message() {
2835
let new_height = window.innerHeight - $q("#djm_message_container").getBoundingClientRect().top + window.scrollY + window.pageYOffset -10
2936
$q("#djm_message_container").style.height = new_height + "px";

0 commit comments

Comments
 (0)