mirror of
https://github.com/ankitects/anki.git
synced 2026-01-09 12:03:56 -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(),
|
name: tr.studyingBuryCard(),
|
||||||
shortcut: "-",
|
shortcut: "-",
|
||||||
onClick: state.buryCurrentCard.bind(state),
|
onClick: state.buryOrSuspendCurrentCard.bind(state, false),
|
||||||
},
|
},
|
||||||
{ name: tr.actionsForgetCard(), shortcut: "Ctrl+Alt+N", onClick: todo },
|
{ 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",
|
shortcut: "Ctrl+Shift+D",
|
||||||
onClick: state.displaySetDueDateMenu.bind(state),
|
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.actionsOptions(), shortcut: "O", onClick: todo },
|
||||||
{
|
{
|
||||||
name: tr.actionsCardInfo(),
|
name: tr.actionsCardInfo(),
|
||||||
|
|
@ -52,8 +56,16 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
"hr",
|
"hr",
|
||||||
// Notes
|
// Notes
|
||||||
{ name: tr.studyingMarkNote(), shortcut: "*", onClick: todo },
|
{ 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.actionsCreateCopy(), shortcut: "Ctrl+Alt+E", onClick: todo },
|
||||||
{
|
{
|
||||||
name: tr.studyingDeleteNote(),
|
name: tr.studyingDeleteNote(),
|
||||||
|
|
|
||||||
|
|
@ -112,12 +112,25 @@ export class ReviewerState {
|
||||||
this.displayMenu("CardInfo");
|
this.displayMenu("CardInfo");
|
||||||
}
|
}
|
||||||
|
|
||||||
public buryCurrentCard() {
|
public buryOrSuspendCurrentCard(suspend: boolean) {
|
||||||
|
const mode = suspend ? BuryOrSuspendCardsRequest_Mode.SUSPEND : BuryOrSuspendCardsRequest_Mode.BURY_USER;
|
||||||
if (this.currentCard?.card?.id) {
|
if (this.currentCard?.card?.id) {
|
||||||
buryOrSuspendCards({
|
buryOrSuspendCards({
|
||||||
cardIds: [this.currentCard?.card?.id],
|
cardIds: [this.currentCard.card.id],
|
||||||
noteIds: [],
|
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();
|
this.refresh();
|
||||||
}
|
}
|
||||||
|
|
@ -167,7 +180,7 @@ export class ReviewerState {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "-": {
|
case "-": {
|
||||||
this.buryCurrentCard();
|
this.buryOrSuspendCurrentCard(false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue