mirror of
https://github.com/ankitects/anki.git
synced 2026-01-07 02:53:54 -05:00
Added: Bury/Suspend More menu
This commit is contained in:
parent
d96809cdfa
commit
723bd9a095
2 changed files with 33 additions and 8 deletions
|
|
@ -32,7 +32,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
{
|
||||
name: tr.studyingBuryCard(),
|
||||
shortcut: "-",
|
||||
onClick: state.buryCurrentCard.bind(state),
|
||||
onClick: state.buryOrSuspendCurrentCard.bind(state, false),
|
||||
},
|
||||
{ name: tr.actionsForgetCard(), shortcut: "Ctrl+Alt+N", onClick: todo },
|
||||
{
|
||||
|
|
@ -40,7 +40,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
shortcut: "Ctrl+Shift+D",
|
||||
onClick: state.displaySetDueDateMenu.bind(state),
|
||||
},
|
||||
{ name: tr.actionsSuspendCard(), shortcut: "@", onClick: todo },
|
||||
{
|
||||
name: tr.actionsSuspendCard(),
|
||||
shortcut: "@",
|
||||
onClick: state.buryOrSuspendCurrentCard.bind(state, true),
|
||||
},
|
||||
{ name: tr.actionsOptions(), shortcut: "O", onClick: todo },
|
||||
{
|
||||
name: tr.actionsCardInfo(),
|
||||
|
|
@ -52,8 +56,16 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
"hr",
|
||||
// Notes
|
||||
{ name: tr.studyingMarkNote(), shortcut: "*", onClick: todo },
|
||||
{ name: tr.studyingBuryNote(), shortcut: "=", onClick: todo },
|
||||
{ name: tr.studyingSuspendNote(), shortcut: "!", onClick: todo },
|
||||
{
|
||||
name: tr.studyingBuryNote(),
|
||||
shortcut: "=",
|
||||
onClick: state.buryOrSuspendCurrentNote.bind(state, false),
|
||||
},
|
||||
{
|
||||
name: tr.studyingSuspendNote(),
|
||||
shortcut: "!",
|
||||
onClick: state.buryOrSuspendCurrentNote.bind(state, true),
|
||||
},
|
||||
{ name: tr.actionsCreateCopy(), shortcut: "Ctrl+Alt+E", onClick: todo },
|
||||
{
|
||||
name: tr.studyingDeleteNote(),
|
||||
|
|
|
|||
|
|
@ -112,12 +112,25 @@ export class ReviewerState {
|
|||
this.displayMenu("CardInfo");
|
||||
}
|
||||
|
||||
public buryCurrentCard() {
|
||||
public buryOrSuspendCurrentCard(suspend: boolean) {
|
||||
const mode = suspend ? BuryOrSuspendCardsRequest_Mode.SUSPEND : BuryOrSuspendCardsRequest_Mode.BURY_USER;
|
||||
if (this.currentCard?.card?.id) {
|
||||
buryOrSuspendCards({
|
||||
cardIds: [this.currentCard?.card?.id],
|
||||
cardIds: [this.currentCard.card.id],
|
||||
noteIds: [],
|
||||
mode: BuryOrSuspendCardsRequest_Mode.BURY_USER,
|
||||
mode,
|
||||
});
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
public buryOrSuspendCurrentNote(suspend: boolean) {
|
||||
const mode = suspend ? BuryOrSuspendCardsRequest_Mode.SUSPEND : BuryOrSuspendCardsRequest_Mode.BURY_USER;
|
||||
if (this.currentCard?.card?.noteId) {
|
||||
buryOrSuspendCards({
|
||||
cardIds: [],
|
||||
noteIds: [this.currentCard.card.noteId],
|
||||
mode,
|
||||
});
|
||||
this.refresh();
|
||||
}
|
||||
|
|
@ -167,7 +180,7 @@ export class ReviewerState {
|
|||
break;
|
||||
}
|
||||
case "-": {
|
||||
this.buryCurrentCard();
|
||||
this.buryOrSuspendCurrentCard(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue