mirror of
https://github.com/poanse/obsidian-taskmap.git
synced 2026-07-22 06:05:58 +00:00
cancel reparenting mode on changing parent
This commit is contained in:
parent
2a661389f0
commit
adf5cd1fe4
3 changed files with 2 additions and 3 deletions
|
|
@ -190,6 +190,7 @@ export class Context {
|
|||
}
|
||||
|
||||
public finishReparenting(newParentId: TaskId) {
|
||||
this.pressedButtonCode = -1;
|
||||
if (this.reparentingTaskId == NoTaskId) {
|
||||
throw new Error("Incorrect state: reparentingTaskId expected");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,12 +69,10 @@
|
|||
}
|
||||
if (isPressed) {
|
||||
// pressed the same button a second time
|
||||
isPressed = false;
|
||||
context.pressedButtonCode = -1;
|
||||
return;
|
||||
} else if (stateful) {
|
||||
// pressed a stateful button
|
||||
isPressed = true;
|
||||
context.pressedButtonCode = iconCode;
|
||||
} else {
|
||||
// pressed a stateless button
|
||||
|
|
@ -98,7 +96,6 @@
|
|||
context.chosenBlockerId = context.chosenBlockerId === NoTaskId ? context.selectedTaskId : NoTaskId;
|
||||
}
|
||||
}
|
||||
|
||||
let classString = $derived(`
|
||||
${(isPressed && !isButtonDisabled) ? 'is-pressed-up ': ''}
|
||||
${(isPressedDown && !isButtonDisabled) ? 'is-pressed-down ': '' }
|
||||
|
|
|
|||
|
|
@ -92,6 +92,7 @@
|
|||
else if (context.isReparentingOn()) {
|
||||
if (context.isValidReparentingTarget(taskId)) {
|
||||
context.finishReparenting(taskId);
|
||||
context.cancelReparenting();
|
||||
}
|
||||
} else {
|
||||
context.pressedButtonCode = -1;
|
||||
|
|
|
|||
Loading…
Reference in a new issue