mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-09-01 08:12:32 +00:00
differentiate shift click and ctrl click on tabs
This commit is contained in:
@@ -63,13 +63,16 @@
|
||||
sortable = Sortable.create(container, {
|
||||
forceAutoScrollFallback: true,
|
||||
multiDrag: true,
|
||||
multiDragKey: 'shift',
|
||||
multiDragKey: 'Meta',
|
||||
selectedClass: 'sortable-selected',
|
||||
avoidImplicitDeselect: true,
|
||||
onSelect: (e) => {
|
||||
let selectedId = e.item.getAttribute('data-id');
|
||||
addSelectFile(selectedId);
|
||||
if (!e.originalEvent.shiftKey && $selectedFiles.size > 1) {
|
||||
if (
|
||||
!(e.originalEvent.shiftKey || e.originalEvent.ctrlKey || e.originalEvent.metaKey) &&
|
||||
$selectedFiles.size > 1
|
||||
) {
|
||||
$selectedFiles.forEach((fileId) => {
|
||||
if (fileId !== selectedId) {
|
||||
deselectFile(fileId);
|
||||
|
@@ -27,9 +27,20 @@
|
||||
<ContextMenu.Trigger>
|
||||
<Button
|
||||
variant="outline"
|
||||
class="h-9 px-1.5 py-1 border-none shadow-md focus-visible:ring-0 focus-visible:ring-offset-0"
|
||||
class="h-9 p-0 border-none shadow-md focus-visible:ring-0 focus-visible:ring-offset-0"
|
||||
>
|
||||
{$file.metadata.name}
|
||||
<span
|
||||
class="w-full h-full px-1.5 py-2"
|
||||
on:contextmenu={(e) => {
|
||||
if (e.ctrlKey) {
|
||||
get(selectFiles).addSelect($file._data.id);
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
}
|
||||
}}
|
||||
>
|
||||
{$file.metadata.name}
|
||||
</span>
|
||||
</Button>
|
||||
</ContextMenu.Trigger>
|
||||
<ContextMenu.Content>
|
||||
|
Reference in New Issue
Block a user