mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-28 12:05:22 +03:00
Fix some drag & drop issues before demo
This commit is contained in:
parent
707707ba52
commit
d4e4f9749a
@ -52,7 +52,7 @@
|
||||
id: `${Date.now()}-${file.id}-commit`,
|
||||
description: '',
|
||||
kind: 'commit',
|
||||
files: [file],
|
||||
files: [{ ...file, isDndShadowItem: false }],
|
||||
isDndShadowItem: !isFinal
|
||||
}
|
||||
]
|
||||
|
@ -36,9 +36,9 @@
|
||||
for (const file of fileItems) {
|
||||
commitItems.push({
|
||||
id: `${Date.now()}-${file.id}`,
|
||||
description: '',
|
||||
description: 'New commit',
|
||||
kind: 'commit',
|
||||
files: [file],
|
||||
files: [{ ...file, isDndShadowItem: false }],
|
||||
isDndShadowItem: !isFinal
|
||||
});
|
||||
}
|
||||
|
@ -50,24 +50,26 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<div
|
||||
id="commit-{id}"
|
||||
class="flex flex-grow flex-col gap-y-2 border border-zinc-700 bg-zinc-900/70 p-2"
|
||||
use:dndzone={{
|
||||
items: files,
|
||||
flipDurationMs,
|
||||
zoneTabIndex: -1,
|
||||
types: ['file'],
|
||||
receives: ['file', 'hunk']
|
||||
}}
|
||||
on:consider={(e) => handleDndEvent(e, false)}
|
||||
on:finalize={(e) => handleDndEvent(e, true)}
|
||||
>
|
||||
{#each files.filter((x) => x.hunks) as file, idx (file.id)}
|
||||
<div animate:flip={{ duration: flipDurationMs }}>
|
||||
<FileCard bind:file on:empty={handleEmpty} />
|
||||
</div>
|
||||
{/each}
|
||||
<div class="flex flex-col gap-y-2 border border-zinc-700 bg-zinc-900/70 p-2">
|
||||
<div
|
||||
class="flex flex-col gap-y-2"
|
||||
id="commit-{id}"
|
||||
use:dndzone={{
|
||||
items: files,
|
||||
flipDurationMs,
|
||||
zoneTabIndex: -1,
|
||||
types: ['file'],
|
||||
receives: ['file', 'hunk']
|
||||
}}
|
||||
on:consider={(e) => handleDndEvent(e, false)}
|
||||
on:finalize={(e) => handleDndEvent(e, true)}
|
||||
>
|
||||
{#each files.filter((x) => x.hunks) as file, idx (file.id)}
|
||||
<div animate:flip={{ duration: flipDurationMs }}>
|
||||
<FileCard bind:file on:empty={handleEmpty} />
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
<div>
|
||||
{description}
|
||||
</div>
|
||||
|
11
src/routes/projects_new/[projectId]/helpers.ts
Normal file
11
src/routes/projects_new/[projectId]/helpers.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import type { Commit, File } from './types';
|
||||
|
||||
export function createCommit(files: File[], isShadow: boolean): Commit {
|
||||
return {
|
||||
id: `commit-${Date.now()}`,
|
||||
description: '',
|
||||
kind: 'commit',
|
||||
files: files,
|
||||
isDndShadowItem: isShadow
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user