mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-22 08:20:39 +00:00
Fix Issues TSK-220, TSK-221 (#2170)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
07f25de59f
commit
c1a8b89855
@ -275,7 +275,7 @@ export const actionTemplates = template({
|
|||||||
label: task.string.Archive,
|
label: task.string.Archive,
|
||||||
message: task.string.ArchiveConfirm
|
message: task.string.ArchiveConfirm
|
||||||
},
|
},
|
||||||
input: 'focus',
|
input: 'any',
|
||||||
category: task.category.Task,
|
category: task.category.Task,
|
||||||
query: {
|
query: {
|
||||||
archived: false
|
archived: false
|
||||||
@ -296,7 +296,7 @@ export const actionTemplates = template({
|
|||||||
label: task.string.Unarchive,
|
label: task.string.Unarchive,
|
||||||
message: task.string.UnarchiveConfirm
|
message: task.string.UnarchiveConfirm
|
||||||
},
|
},
|
||||||
input: 'focus',
|
input: 'any',
|
||||||
category: task.category.Task,
|
category: task.category.Task,
|
||||||
query: {
|
query: {
|
||||||
archived: true
|
archived: true
|
||||||
|
@ -27,6 +27,8 @@
|
|||||||
export let okLabel: IntlString = presentation.string.Create
|
export let okLabel: IntlString = presentation.string.Create
|
||||||
|
|
||||||
const dispatch = createEventDispatcher()
|
const dispatch = createEventDispatcher()
|
||||||
|
|
||||||
|
let okProcessing = false
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<form id={label} class="antiCard dialog" on:submit|preventDefault={() => {}}>
|
<form id={label} class="antiCard dialog" on:submit|preventDefault={() => {}}>
|
||||||
@ -71,17 +73,24 @@
|
|||||||
<MiniToggle label={presentation.string.CreateMore} bind:on={createMore} />
|
<MiniToggle label={presentation.string.CreateMore} bind:on={createMore} />
|
||||||
{/if}
|
{/if}
|
||||||
<Button
|
<Button
|
||||||
|
loading={okProcessing}
|
||||||
focusIndex={10001}
|
focusIndex={10001}
|
||||||
disabled={!canSave}
|
disabled={!canSave}
|
||||||
label={okLabel}
|
label={okLabel}
|
||||||
kind={'primary'}
|
kind={'primary'}
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
|
if (okProcessing) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
okProcessing = true
|
||||||
const r = okAction()
|
const r = okAction()
|
||||||
if (r instanceof Promise && !createMore) {
|
if (r instanceof Promise && !createMore) {
|
||||||
r.then(() => {
|
r.then(() => {
|
||||||
|
okProcessing = false
|
||||||
dispatch('close')
|
dispatch('close')
|
||||||
})
|
})
|
||||||
} else if (!createMore) {
|
} else if (!createMore) {
|
||||||
|
okProcessing = false
|
||||||
dispatch('close')
|
dispatch('close')
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
@ -125,8 +125,9 @@
|
|||||||
{/if}
|
{/if}
|
||||||
{#if loading}
|
{#if loading}
|
||||||
<Spinner />
|
<Spinner />
|
||||||
{:else if label}
|
{/if}
|
||||||
<span class="overflow-label disabled">
|
{#if label}
|
||||||
|
<span class="overflow-label disabled" class:ml-2={loading}>
|
||||||
<Label {label} params={labelParams} />
|
<Label {label} params={labelParams} />
|
||||||
</span>
|
</span>
|
||||||
{:else if $$slots.content}
|
{:else if $$slots.content}
|
||||||
|
@ -20,6 +20,7 @@ export function resizeObserver (element: Element, onResize: (element: Element) =
|
|||||||
if (observer === undefined) {
|
if (observer === undefined) {
|
||||||
callbacks = new WeakMap()
|
callbacks = new WeakMap()
|
||||||
observer = new ResizeObserver((entries) => {
|
observer = new ResizeObserver((entries) => {
|
||||||
|
window.requestAnimationFrame(() => {
|
||||||
for (const entry of entries) {
|
for (const entry of entries) {
|
||||||
const onResize = callbacks.get(entry.target)
|
const onResize = callbacks.get(entry.target)
|
||||||
if (onResize != null) {
|
if (onResize != null) {
|
||||||
@ -27,6 +28,7 @@ export function resizeObserver (element: Element, onResize: (element: Element) =
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
callbacks.set(element, onResize)
|
callbacks.set(element, onResize)
|
||||||
|
Loading…
Reference in New Issue
Block a user