From fafab95a07607e7ee27088c5bae1c88e2ba99553 Mon Sep 17 00:00:00 2001 From: zadam Date: Mon, 14 Oct 2019 12:06:10 +0200 Subject: [PATCH] auto-book has variable number of columns based on the right pane width --- .../javascripts/services/note_detail_book.js | 17 ++++++++++++++++- src/public/stylesheets/style.css | 3 ++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/public/javascripts/services/note_detail_book.js b/src/public/javascripts/services/note_detail_book.js index 2ec97101b..03286738f 100644 --- a/src/public/javascripts/services/note_detail_book.js +++ b/src/public/javascripts/services/note_detail_book.js @@ -237,7 +237,22 @@ class NoteDetailBook { } getDefaultZoomLevel() { - return this.isAutoBook() ? 3 : 1; + if (this.isAutoBook()) { + const w = this.$component.width(); + + if (w <= 600) { + return 1; + } else if (w <= 900) { + return 2; + } else if (w <= 1300) { + return 3; + } else { + return 4; + } + } + else { + return 1; + } } getRenderingType(childNote) { diff --git a/src/public/stylesheets/style.css b/src/public/stylesheets/style.css index 059c0d734..ae65c157e 100644 --- a/src/public/stylesheets/style.css +++ b/src/public/stylesheets/style.css @@ -809,7 +809,8 @@ a.external:not(.no-arrow):after, a[href^="http://"]:not(.no-arrow):after, a[href border-radius: 10px; background-color: var(--accented-background-color); padding: 15px; - margin: 10px; + padding-bottom: 5px; + margin: 5px; margin-left: 0; overflow: hidden; display: flex;