handle series of (de)select events together
This commit is contained in:
parent
c5dea0aeda
commit
f75e2a5278
1 changed files with 35 additions and 26 deletions
|
@ -48,8 +48,15 @@
|
|||
let sortable: Sortable;
|
||||
let orientation = getContext<'vertical' | 'horizontal'>('orientation');
|
||||
|
||||
let lastUpdateStart = 0;
|
||||
function updateToSelection(e) {
|
||||
if (updating) return;
|
||||
lastUpdateStart = Date.now();
|
||||
setTimeout(() => {
|
||||
if (Date.now() - lastUpdateStart >= 40) {
|
||||
if (updating) {
|
||||
return;
|
||||
}
|
||||
|
||||
updating = true;
|
||||
// Sortable updates selection
|
||||
let changed = getChangedIds();
|
||||
|
@ -78,6 +85,8 @@
|
|||
}
|
||||
updating = false;
|
||||
}
|
||||
}, 50);
|
||||
}
|
||||
|
||||
function updateFromSelection() {
|
||||
if (updating) return;
|
||||
|
|
Loading…
Reference in a new issue