mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-11-30 11:32:04 +03:00
disable dragging for locked files
This commit is contained in:
parent
19cbb91961
commit
6c8544acd8
@ -51,6 +51,8 @@
|
||||
|
||||
$: popupMenu = updateContextMenu();
|
||||
|
||||
$: isLocked = file.hunks.some((h) => h.locked);
|
||||
|
||||
onDestroy(() => {
|
||||
if (popupMenu) {
|
||||
popupMenu.$destroy();
|
||||
@ -89,7 +91,7 @@
|
||||
}}
|
||||
use:draggable={{
|
||||
data: new DraggableFile($branch?.id || '', file, selectedFiles),
|
||||
disabled: readonly || isUnapplied,
|
||||
disabled: readonly || isUnapplied || isLocked,
|
||||
viewportId: 'board-viewport',
|
||||
selector: '.selected-draggable'
|
||||
}}
|
||||
|
@ -101,7 +101,7 @@ export function draggable(node: HTMLElement, opts: DraggableConfig) {
|
||||
// elements, falling back to the single node executing the drag.
|
||||
if (opts.selector) {
|
||||
selectedElements = Array.from(
|
||||
document.querySelectorAll(opts.selector || '').values() as Iterable<HTMLElement>
|
||||
document.querySelectorAll(opts.selector).values() as Iterable<HTMLElement>
|
||||
);
|
||||
|
||||
if (selectedElements.length > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user