diff --git a/plugs/index/asset/style.css b/plugs/index/asset/style.css index 9846181b..ced05575 100644 --- a/plugs/index/asset/style.css +++ b/plugs/index/asset/style.css @@ -1,8 +1,9 @@ /* Reset SB styles */ html, body { - height: initial !important; - overflow: initial !important; + /*height: initial !important; + overflow-x: initial !important; + overflow-y: hidden !important;*/ background-color: var(--root-background-color) !important; } diff --git a/plugs/markdown/assets/markdown_widget.css b/plugs/markdown/assets/markdown_widget.css index e494680f..fb28cab3 100644 --- a/plugs/markdown/assets/markdown_widget.css +++ b/plugs/markdown/assets/markdown_widget.css @@ -33,6 +33,7 @@ ol { ul { list-style: none; + padding-left: 1ch; } ul li::before { diff --git a/plugs/markdown/assets/markdown_widget.js b/plugs/markdown/assets/markdown_widget.js index 7d864201..1bb29250 100644 --- a/plugs/markdown/assets/markdown_widget.js +++ b/plugs/markdown/assets/markdown_widget.js @@ -47,7 +47,7 @@ async function init() { const messageData = e.data; switch (messageData.type) { case "setHeight": - iframe.style.height = messageData.height + "px"; + iframe.height = messageData.height + "px"; // Propagate height setting to parent updateHeight(); break; diff --git a/web/cm_plugins/fenced_code.ts b/web/cm_plugins/fenced_code.ts index a035808d..28737ab8 100644 --- a/web/cm_plugins/fenced_code.ts +++ b/web/cm_plugins/fenced_code.ts @@ -55,7 +55,8 @@ class IFrameWidget extends WidgetType { }, ); - iframe.style.height = `${this.estimatedHeight}px`; + const estimatedHeight = this.estimatedHeight; + iframe.height = `${estimatedHeight}px`; return iframe; } diff --git a/web/components/panel_html.ts b/web/components/panel_html.ts index 12eaab9a..5aed47ce 100644 --- a/web/components/panel_html.ts +++ b/web/components/panel_html.ts @@ -105,7 +105,8 @@ function loadJsByUrl(url) { html, body { height: initial !important; - overflow: initial !important; + overflow-x: initial !important; + overflow-y: hidden !important; background-color: var(--root-background-color); } diff --git a/web/components/widget_sandbox_iframe.ts b/web/components/widget_sandbox_iframe.ts index 2844891e..ee0702e5 100644 --- a/web/components/widget_sandbox_iframe.ts +++ b/web/components/widget_sandbox_iframe.ts @@ -32,7 +32,7 @@ function updatePool(exclude?: PreloadedIFrame) { preloadedIframe.used && !document.body.contains(preloadedIframe.iframe) ) { // Ditch it - console.log("Garbage collecting iframe", preloadedIframe); + // console.log("Garbage collecting iframe", preloadedIframe); iframePool.delete(preloadedIframe); } if (!preloadedIframe.used) { @@ -46,7 +46,7 @@ function updatePool(exclude?: PreloadedIFrame) { } export function prepareSandboxIFrame(): PreloadedIFrame { - console.log("Preloading iframe"); + // console.log("Preloading iframe"); const iframe = document.createElement("iframe"); // Empty page with current origin. Handled this differently before, but "dock apps" in Safari (PWA implementation) seem to have various restrictions @@ -70,7 +70,7 @@ export function prepareSandboxIFrame(): PreloadedIFrame { function claimIFrame(): PreloadedIFrame { for (const preloadedIframe of iframePool) { if (!preloadedIframe.used) { - console.log("Took iframe from pool"); + // console.log("Took iframe from pool"); preloadedIframe.used = true; updatePool(preloadedIframe); return preloadedIframe; @@ -108,6 +108,7 @@ export function mountIFrame( onMessage?: (message: any) => void, ) { const iframe = preloadedIFrame.iframe; + preloadedIFrame.ready.then(async () => { const messageListener = (evt: any) => { (async () => { @@ -146,7 +147,7 @@ export function mountIFrame( break; } case "setHeight": - iframe.style.height = data.height + "px"; + iframe.height = data.height + "px"; if (widgetHeightCacheKey) { client.space.setCachedWidgetHeight( widgetHeightCacheKey, @@ -183,10 +184,10 @@ export function mountIFrame( } else if (resolvedContent.url) { iframe.contentWindow!.location.href = resolvedContent.url; if (resolvedContent.height) { - iframe.style.height = resolvedContent.height + "px"; + iframe.height = resolvedContent.height + "px"; } if (resolvedContent.width) { - iframe.style.width = resolvedContent.width + "px"; + iframe.width = resolvedContent.width + "px"; } } }).catch(console.error); diff --git a/web/space.ts b/web/space.ts index 882aa8b6..cf709c6a 100644 --- a/web/space.ts +++ b/web/space.ts @@ -35,7 +35,7 @@ export class Space { .catch( console.error, ); - console.log("Flushed widget height cache to store"); + // console.log("Flushed widget height cache to store"); }, 5000); setCachedWidgetHeight(bodyText: string, height: number) { diff --git a/web/styles/editor.scss b/web/styles/editor.scss index 3a34aebc..a194a6e7 100644 --- a/web/styles/editor.scss +++ b/web/styles/editor.scss @@ -437,7 +437,7 @@ font-weight: bold; } - // this seems to not be used anymore + // Allow for cursor movement into a code widget fenced code block from bottom-up .sb-fenced-code-hide { background-color: transparent; line-height: 0;