From 78c582493ceb44a0d9b7a07148eb3f2ebd48fa53 Mon Sep 17 00:00:00 2001 From: Pavel Mineev Date: Fri, 12 Mar 2021 01:40:46 +0300 Subject: [PATCH] don't add margin on user info iframe --- frontend/app/embed.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/app/embed.ts b/frontend/app/embed.ts index cb1ccfb4..504c6d1a 100644 --- a/frontend/app/embed.ts +++ b/frontend/app/embed.ts @@ -17,11 +17,13 @@ function createFrame({ host, query, height, + margin = '-6px', __colors__ = {}, }: { host: string; query: string; height?: string; + margin?: string; __colors__?: Record; }) { const iframe = document.createElement('iframe'); @@ -38,7 +40,7 @@ function createFrame({ iframe.setAttribute('verticalscrolling', 'no'); iframe.setAttribute( 'style', - 'width: 1px !important; min-width: 100% !important; border: none !important; overflow: hidden !important; margin: -6px;' + `width: 1px !important; min-width: 100% !important; border: none !important; overflow: hidden !important; margin: ${margin};` ); if (height) { @@ -200,7 +202,7 @@ function createInstance(config: typeof window.remark_config) { const queryUserInfo = `${query}&page=user-info&&id=${user.id}&name=${user.name}&picture=${ user.picture || '' }&isDefaultPicture=${user.isDefaultPicture || 0}`; - const iframe = createFrame({ host: BASE_URL, query: queryUserInfo, height: '100%' }); + const iframe = createFrame({ host: BASE_URL, query: queryUserInfo, height: '100%', margin: '0' }); this.node.appendChild(iframe); this.iframe = iframe; this.node.appendChild(this.closeEl);