mirror of
https://github.com/ankitects/anki.git
synced 2026-01-07 02:53:54 -05:00
Added: Edit shortcut
This commit is contained in:
parent
5b35fd7bc3
commit
40d7ce88aa
2 changed files with 18 additions and 3 deletions
|
|
@ -10,7 +10,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
import type { ReviewerState } from "../reviewer";
|
||||
import Remaining from "./Remaining.svelte";
|
||||
import More from "./More.svelte";
|
||||
import { displayEditMenu } from "@generated/backend";
|
||||
|
||||
export let state: ReviewerState;
|
||||
|
||||
|
|
@ -26,7 +25,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
<div class="disappearing edit">
|
||||
<button
|
||||
title={tr.actionsShortcutKey({ val: "E" })}
|
||||
on:click={() => displayEditMenu({ cid: state.currentCard?.card?.id })}
|
||||
on:click={() => state.displayEditMenu()}
|
||||
>
|
||||
{tr.studyingEdit()}
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,16 @@
|
|||
// Copyright: Ankitects Pty Ltd and contributors
|
||||
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||
import { CardAnswer, type NextCardDataResponse_NextCardData } from "@generated/anki/scheduler_pb";
|
||||
import { compareAnswer, getConfigJson, nextCardData, playAvtags, redo, setConfigJson, undo } from "@generated/backend";
|
||||
import {
|
||||
compareAnswer,
|
||||
displayEditMenu,
|
||||
getConfigJson,
|
||||
nextCardData,
|
||||
playAvtags,
|
||||
redo,
|
||||
setConfigJson,
|
||||
undo,
|
||||
} from "@generated/backend";
|
||||
import { derived, get, writable } from "svelte/store";
|
||||
import type { InnerReviewerRequest } from "../reviewer-inner/innerReviewerRequest";
|
||||
import type { ReviewerRequest } from "./reviewerRequest";
|
||||
|
|
@ -82,6 +91,10 @@ export class ReviewerState {
|
|||
this.showQuestion(null);
|
||||
}
|
||||
|
||||
public displayEditMenu() {
|
||||
displayEditMenu({ cid: this.currentCard?.card?.id });
|
||||
}
|
||||
|
||||
async handleKeyPress(key: string, ctrl: boolean, shift: boolean) {
|
||||
key = key.toLowerCase();
|
||||
switch (key) {
|
||||
|
|
@ -121,6 +134,9 @@ export class ReviewerState {
|
|||
}
|
||||
break;
|
||||
}
|
||||
case "e": {
|
||||
this.displayEditMenu();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue