This commit is contained in:
Jan Prochazka
2022-06-02 19:18:15 +02:00
parent 1534099dc4
commit 07d4b248bf
2 changed files with 48 additions and 44 deletions

View File

@@ -315,7 +315,7 @@
); );
} }
$: isPinned = !!$pinnedDatabases.find(x => x.name == data.name && x.connection?._id == data.connection?._id); $: isPinned = !!$pinnedDatabases.find(x => x?.name == data.name && x?.connection?._id == data.connection?._id);
$: apps = useUsedApps(); $: apps = useUsedApps();
</script> </script>

View File

@@ -13,6 +13,7 @@
if (!compare(dragged, data)) { if (!compare(dragged, data)) {
const i1 = _.findIndex(pinned, x => compare(x, dragged)); const i1 = _.findIndex(pinned, x => compare(x, dragged));
const i2 = _.findIndex(pinned, x => compare(x, data)); const i2 = _.findIndex(pinned, x => compare(x, data));
if (i1 >= 0 && i2 >= 0 && i1 != i2) {
const newPinned = [...pinned]; const newPinned = [...pinned];
const tmp = newPinned[i1]; const tmp = newPinned[i1];
newPinned[i1] = newPinned[i2]; newPinned[i1] = newPinned[i2];
@@ -20,6 +21,7 @@
setPinned(newPinned); setPinned(newPinned);
} }
} }
}
</script> </script>
<script lang="ts"> <script lang="ts">
@@ -29,7 +31,8 @@
export let data; export let data;
</script> </script>
{#if data.objectTypeField} {#if data}
{#if data.objectTypeField}
<DatabaseObjectAppObject <DatabaseObjectAppObject
{...$$props} {...$$props}
on:dragstart={() => { on:dragstart={() => {
@@ -48,7 +51,7 @@
$draggedPinnedObject = null; $draggedPinnedObject = null;
}} }}
/> />
{:else} {:else}
<DatabaseAppObject <DatabaseAppObject
{...$$props} {...$$props}
on:dragstart={() => { on:dragstart={() => {
@@ -67,4 +70,5 @@
$draggedPinnedObject = null; $draggedPinnedObject = null;
}} }}
/> />
{/if}
{/if} {/if}