mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-23 03:22:19 +03:00
Hides the sidebar when narrowed (#1661)
Signed-off-by: Alexander Platov <sas_lord@mail.ru>
This commit is contained in:
parent
19229fcd23
commit
def00d4eb2
@ -32,15 +32,9 @@
|
||||
export let isSub: boolean = true
|
||||
export let isAside: boolean = true
|
||||
export let isCustomAttr: boolean = true
|
||||
export let minimize: boolean = false
|
||||
|
||||
let docWidth: number = 0
|
||||
$: minimize = docWidth < 1280 && docWidth >= 1024
|
||||
$: needHeader = $$slots.header || minimize || isHeader
|
||||
</script>
|
||||
|
||||
<svelte:window bind:innerWidth={docWidth} />
|
||||
<Panel bind:isAside isHeader={needHeader} bind:panelWidth bind:innerWidth on:close>
|
||||
<Panel bind:isAside isHeader={$$slots.header || isHeader} bind:panelWidth bind:innerWidth on:close>
|
||||
<svelte:fragment slot="title">
|
||||
<div class="popupPanel-title__content-container antiTitle">
|
||||
{#if $$slots.navigator}
|
||||
@ -72,23 +66,17 @@
|
||||
</svelte:fragment>
|
||||
|
||||
<svelte:fragment slot="header">
|
||||
{#if $$slots.header || ($$slots.actions && minimize)}
|
||||
{#if $$slots.header}
|
||||
<div class="header-row between">
|
||||
{#if $$slots.header}<slot name="header" />{/if}
|
||||
<div class="buttons-group xsmall-gap ml-4">
|
||||
<slot name="tools" />
|
||||
{#if $$slots.actions && minimize}
|
||||
<div class="buttons-divider" />
|
||||
<slot name="actions" />
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{#if $$slots['custom-attributes'] && isCustomAttr}
|
||||
{#if isSub}<div class="header-row"><slot name="custom-attributes" direction="row" /></div>{/if}
|
||||
{:else if $$slots.attributes && minimize}<div class="header-row">
|
||||
<slot name="attributes" direction="row" />
|
||||
</div>{/if}
|
||||
{/if}
|
||||
</svelte:fragment>
|
||||
|
||||
<svelte:fragment slot="aside">
|
||||
|
@ -25,15 +25,13 @@
|
||||
|
||||
let asideFloat: boolean = false
|
||||
let asideShown: boolean = false
|
||||
let docWidth: number
|
||||
$: if (docWidth < 1024 && !asideFloat) asideFloat = true
|
||||
$: if (docWidth >= 1024 && asideFloat) {
|
||||
$: if (panelWidth < 900 && !asideFloat) asideFloat = true
|
||||
$: if (panelWidth >= 900 && asideFloat) {
|
||||
asideFloat = false
|
||||
asideShown = false
|
||||
}
|
||||
</script>
|
||||
|
||||
<svelte:window bind:innerWidth={docWidth} />
|
||||
<div class="popupPanel" bind:clientWidth={panelWidth}>
|
||||
<div class="popupPanel-title">
|
||||
<Button
|
||||
|
@ -72,7 +72,6 @@
|
||||
onMount(() => {
|
||||
dispatch('open', { ignoreKeys: ['comments', 'number', 'title'] })
|
||||
})
|
||||
let minimize: boolean = false
|
||||
</script>
|
||||
|
||||
{#if object !== undefined}
|
||||
@ -80,9 +79,8 @@
|
||||
icon={board.icon.Card}
|
||||
title={object?.title}
|
||||
{object}
|
||||
bind:minimize
|
||||
isHeader={minimize}
|
||||
isAside={!minimize}
|
||||
isHeader={false}
|
||||
isAside={true}
|
||||
on:close={() => dispatch('close')}
|
||||
>
|
||||
<svelte:fragment slot="navigator">
|
||||
|
@ -89,16 +89,14 @@
|
||||
onMount(() => {
|
||||
dispatch('open', { ignoreKeys: ['comments', 'name', 'description', 'number'] })
|
||||
})
|
||||
let minimize: boolean = false
|
||||
</script>
|
||||
|
||||
{#if issue !== undefined}
|
||||
<Panel
|
||||
object={issue}
|
||||
bind:minimize
|
||||
isHeader
|
||||
isAside={!minimize}
|
||||
isSub={minimize}
|
||||
isAside={true}
|
||||
isSub={false}
|
||||
bind:innerWidth
|
||||
on:close={() => {
|
||||
dispatch('close')
|
||||
|
@ -211,7 +211,6 @@
|
||||
}
|
||||
let panelWidth: number = 0
|
||||
let innerWidth: number = 0
|
||||
let minimize: boolean = false
|
||||
</script>
|
||||
|
||||
<ActionContext
|
||||
@ -225,9 +224,8 @@
|
||||
{icon}
|
||||
{title}
|
||||
{object}
|
||||
bind:minimize
|
||||
isHeader={false}
|
||||
isAside={!minimize}
|
||||
isAside={true}
|
||||
bind:panelWidth
|
||||
bind:innerWidth
|
||||
on:update={(ev) => _update(ev.detail)}
|
||||
|
Loading…
Reference in New Issue
Block a user