From 3ae7ed7e3d4554d1ab62ab361334b5845a04c8c1 Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Tue, 9 Jan 2024 09:57:07 +0100 Subject: [PATCH] Maximum heights for top widgets --- web/cm_plugins/markdown_widget.ts | 1 - web/styles/editor.scss | 10 ++++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/web/cm_plugins/markdown_widget.ts b/web/cm_plugins/markdown_widget.ts index 2521640d..16eca17a 100644 --- a/web/cm_plugins/markdown_widget.ts +++ b/web/cm_plugins/markdown_widget.ts @@ -234,7 +234,6 @@ export class MarkdownWidget extends WidgetType { get estimatedHeight(): number { const cacheItem = this.client.getWidgetCache(this.cacheKey); - // console.log("Calling estimated height", this.bodyText, cacheItem); return cacheItem ? cacheItem.height : -1; } diff --git a/web/styles/editor.scss b/web/styles/editor.scss index 7e675b2f..045e7527 100644 --- a/web/styles/editor.scss +++ b/web/styles/editor.scss @@ -429,6 +429,16 @@ margin-top: 10px; } + .sb-markdown-top-widget:has(*) { + max-height: 500px; + } + + @media screen and (max-height: 1000px) { + .sb-markdown-top-widget:has(*) { + max-height: 300px; + } + } + .sb-markdown-widget, .sb-markdown-top-widget:has(*), .sb-markdown-bottom-widget:has(*) {