mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 10:00:13 +01:00
This commit is contained in:
parent
a95edc256c
commit
06c54f43ef
2 changed files with 7 additions and 11 deletions
|
|
@ -182,6 +182,11 @@ export const bindCardEvent = (options: {
|
||||||
const countElement = options.element.querySelector('[data-type="count"] span');
|
const countElement = options.element.querySelector('[data-type="count"] span');
|
||||||
countElement.innerHTML = (index + 1).toString();
|
countElement.innerHTML = (index + 1).toString();
|
||||||
const actionElements = options.element.querySelectorAll(".card__action");
|
const actionElements = options.element.querySelectorAll(".card__action");
|
||||||
|
if (options.index === 0) {
|
||||||
|
actionElements[0].firstElementChild.setAttribute("disabled", "disabled");
|
||||||
|
} else {
|
||||||
|
actionElements[0].firstElementChild.removeAttribute("disabled");
|
||||||
|
}
|
||||||
const filterElement = options.element.querySelector('[data-type="filter"]');
|
const filterElement = options.element.querySelector('[data-type="filter"]');
|
||||||
const fetchNewRound = () => {
|
const fetchNewRound = () => {
|
||||||
const currentCardType = filterElement.getAttribute("data-cardtype");
|
const currentCardType = filterElement.getAttribute("data-cardtype");
|
||||||
|
|
@ -248,7 +253,7 @@ export const bindCardEvent = (options: {
|
||||||
icon: "iconRiffCard",
|
icon: "iconRiffCard",
|
||||||
title: window.siyuan.languages.spaceRepetition,
|
title: window.siyuan.languages.spaceRepetition,
|
||||||
data: {
|
data: {
|
||||||
blocks: options.cardsData.cards,
|
cardsData: options.cardsData,
|
||||||
index,
|
index,
|
||||||
cardType: filterElement.getAttribute("data-cardtype") as TCardType,
|
cardType: filterElement.getAttribute("data-cardtype") as TCardType,
|
||||||
id: filterElement.getAttribute("data-id"),
|
id: filterElement.getAttribute("data-id"),
|
||||||
|
|
@ -351,7 +356,7 @@ export const bindCardEvent = (options: {
|
||||||
}
|
}
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
hideElements(["toolbar", "hint", "util"], editor.protyle);
|
hideElements(["toolbar", "hint", "util", "gutter"], editor.protyle);
|
||||||
if (type === "-1") { // 显示答案
|
if (type === "-1") { // 显示答案
|
||||||
if (actionElements[0].classList.contains("fn__none")) {
|
if (actionElements[0].classList.contains("fn__none")) {
|
||||||
type = "3";
|
type = "3";
|
||||||
|
|
|
||||||
|
|
@ -680,15 +680,6 @@ export const newModelByInitData = (app: App, tab: Tab, json: any) => {
|
||||||
let model: Model;
|
let model: Model;
|
||||||
if (json.instance === "Custom") {
|
if (json.instance === "Custom") {
|
||||||
if (json.customModelType === "siyuan-card") {
|
if (json.customModelType === "siyuan-card") {
|
||||||
// https://github.com/siyuan-note/siyuan/issues/9377 历史数据兼容
|
|
||||||
if (!json.customModelData.cardsData) {
|
|
||||||
json.customModelData.cardsData = {
|
|
||||||
cards: json.customModelData.blocks,
|
|
||||||
unreviewedCount: json.customModelData.blocks.length,
|
|
||||||
unreviewedNewCardCount: 0,
|
|
||||||
unreviewedOldCardCount: json.customModelData.blocks.length
|
|
||||||
}
|
|
||||||
}
|
|
||||||
model = newCardModel({
|
model = newCardModel({
|
||||||
app,
|
app,
|
||||||
tab: tab,
|
tab: tab,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue