From 4c9da57c906416bb09329e578f94d71d95622e01 Mon Sep 17 00:00:00 2001 From: Alexander Platov Date: Fri, 11 Feb 2022 20:50:31 +0700 Subject: [PATCH] Clean code Signed-off-by: Alexander Platov --- packages/theme/styles/components.scss | 3 --- .../task-resources/src/components/state/StatesBar.svelte | 5 +---- .../src/components/state/StatesBarElement.svelte | 8 -------- 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/packages/theme/styles/components.scss b/packages/theme/styles/components.scss index ee6ad5306a..eb9266d2fc 100644 --- a/packages/theme/styles/components.scss +++ b/packages/theme/styles/components.scss @@ -209,7 +209,6 @@ flex: 1 0; padding: 0.125rem 0; min-width: 0; - // width: auto; &::-webkit-scrollbar:horizontal { height: 0.125rem; } &::-webkit-scrollbar-track { margin: 0.25rem; } @@ -233,9 +232,7 @@ position: relative; display: flex; min-width: 0; - // max-width: 100%; width: auto; - // height: auto; &__back { width: auto; diff --git a/plugins/task-resources/src/components/state/StatesBar.svelte b/plugins/task-resources/src/components/state/StatesBar.svelte index 47f226db9f..9224d4d954 100644 --- a/plugins/task-resources/src/components/state/StatesBar.svelte +++ b/plugins/task-resources/src/components/state/StatesBar.svelte @@ -19,7 +19,7 @@ import { createQuery } from '@anticrm/presentation' import task, { SpaceWithStates, State } from '@anticrm/task' import { getPlatformColor } from '@anticrm/ui' - import { createEventDispatcher, onDestroy, onMount, afterUpdate } from 'svelte' + import { createEventDispatcher, onDestroy, onMount } from 'svelte' import StatesBarElement from './StatesBarElement.svelte' import type { StatesBarPosition } from '../..' @@ -87,9 +87,6 @@ } }) onDestroy(() => { if (div) div.removeEventListener('scroll', checkMask) }) - afterUpdate(() => { - console.log('!!!!!!!!!!!!!!!!!!!!!!! UPDATED') - })
diff --git a/plugins/task-resources/src/components/state/StatesBarElement.svelte b/plugins/task-resources/src/components/state/StatesBarElement.svelte index 6099855cc6..84e8d62175 100644 --- a/plugins/task-resources/src/components/state/StatesBarElement.svelte +++ b/plugins/task-resources/src/components/state/StatesBarElement.svelte @@ -28,14 +28,6 @@ let divBar: HTMLElement let svgBack: SVGElement - // $: if (text) lenght = (text.clientWidth + 20 > 300) ? 300 : text.clientWidth + 20 - // $: if (lenght) { - // if (position === 'start') d = `M0,8c0-4.4,3.6-8,8-8h2h${lenght}h1.8c0.8,0,1.6,0.5,1.9,1.3l6.1,16c0.2,0.5,0.2,1,0,1.4l-6.1,16c-0.3,0.8-1,1.3-1.9,1.3L${lenght + 10},36H10 l-2,0c-4.4,0-8-3.6-8-8V8z` - // else if (position === 'middle') d = `M6.1,17.3l-6-15.9C-0.2,0.7,0.3,0,1,0h9h${lenght}h1.8c0.8,0,1.6,0.5,1.9,1.3l6.1,16c0.2,0.5,0.2,1,0,1.4l-6.1,16 c-0.3,0.8-1,1.3-1.9,1.3H${lenght + 10}H10H1c-0.7,0-1.2-0.7-0.9-1.4l6-15.9C6.3,18.3,6.3,17.7,6.1,17.3z` - // else if (position === 'end') d = `M6.1,17.3l-6-15.9C-0.2,0.7,0.3,0,1,0h9h${lenght}h2c4.4,0,8,3.6,8,8v20c0,4.4-3.6,8-8,8h-2H10H1 c-0.7,0-1.2-0.7-0.9-1.4l6-15.9C6.3,18.3,6.3,17.7,6.1,17.3z` - // else d = `M0,8c0-4.4,3.6-8,8-8l2,0h${lenght}l2,0c4.4,0,8,3.6,8,8v20c0,4.4-3.6,8-8,8h-2H10H8c-4.4,0-8-3.6-8-8V8z` - // } - afterUpdate(() => { if (text) lenght = (text.clientWidth + 20 > 300) ? 300 : text.clientWidth + 20 if (divBar) divBar.style.width = lenght + 20 + 'px'