mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-23 08:48:01 +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,
|
||||
message: task.string.ArchiveConfirm
|
||||
},
|
||||
input: 'focus',
|
||||
input: 'any',
|
||||
category: task.category.Task,
|
||||
query: {
|
||||
archived: false
|
||||
@ -296,7 +296,7 @@ export const actionTemplates = template({
|
||||
label: task.string.Unarchive,
|
||||
message: task.string.UnarchiveConfirm
|
||||
},
|
||||
input: 'focus',
|
||||
input: 'any',
|
||||
category: task.category.Task,
|
||||
query: {
|
||||
archived: true
|
||||
|
@ -27,6 +27,8 @@
|
||||
export let okLabel: IntlString = presentation.string.Create
|
||||
|
||||
const dispatch = createEventDispatcher()
|
||||
|
||||
let okProcessing = false
|
||||
</script>
|
||||
|
||||
<form id={label} class="antiCard dialog" on:submit|preventDefault={() => {}}>
|
||||
@ -71,17 +73,24 @@
|
||||
<MiniToggle label={presentation.string.CreateMore} bind:on={createMore} />
|
||||
{/if}
|
||||
<Button
|
||||
loading={okProcessing}
|
||||
focusIndex={10001}
|
||||
disabled={!canSave}
|
||||
label={okLabel}
|
||||
kind={'primary'}
|
||||
on:click={() => {
|
||||
if (okProcessing) {
|
||||
return
|
||||
}
|
||||
okProcessing = true
|
||||
const r = okAction()
|
||||
if (r instanceof Promise && !createMore) {
|
||||
r.then(() => {
|
||||
okProcessing = false
|
||||
dispatch('close')
|
||||
})
|
||||
} else if (!createMore) {
|
||||
okProcessing = false
|
||||
dispatch('close')
|
||||
}
|
||||
}}
|
||||
|
@ -125,8 +125,9 @@
|
||||
{/if}
|
||||
{#if loading}
|
||||
<Spinner />
|
||||
{:else if label}
|
||||
<span class="overflow-label disabled">
|
||||
{/if}
|
||||
{#if label}
|
||||
<span class="overflow-label disabled" class:ml-2={loading}>
|
||||
<Label {label} params={labelParams} />
|
||||
</span>
|
||||
{:else if $$slots.content}
|
||||
|
@ -20,12 +20,14 @@ export function resizeObserver (element: Element, onResize: (element: Element) =
|
||||
if (observer === undefined) {
|
||||
callbacks = new WeakMap()
|
||||
observer = new ResizeObserver((entries) => {
|
||||
for (const entry of entries) {
|
||||
const onResize = callbacks.get(entry.target)
|
||||
if (onResize != null) {
|
||||
onResize(entry.target)
|
||||
window.requestAnimationFrame(() => {
|
||||
for (const entry of entries) {
|
||||
const onResize = callbacks.get(entry.target)
|
||||
if (onResize != null) {
|
||||
onResize(entry.target)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user