mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-10 04:59:03 +08:00
This commit is contained in:
parent
351cc9ce25
commit
b65a27f22b
@ -365,7 +365,7 @@ export const bindCardEvent = async (options: {
|
|||||||
element.previousElementSibling.textContent = options.cardsData.cards[index].nextDues[btnIndex];
|
element.previousElementSibling.textContent = options.cardsData.cards[index].nextDues[btnIndex];
|
||||||
});
|
});
|
||||||
actionElements[1].classList.remove("fn__none");
|
actionElements[1].classList.remove("fn__none");
|
||||||
emitEvent(options.app, options.cardsData.cards, type);
|
emitEvent(options.app, options.cardsData.cards[index], type);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (type === "-2") { // 上一步
|
} else if (type === "-2") { // 上一步
|
||||||
@ -381,7 +381,7 @@ export const bindCardEvent = async (options: {
|
|||||||
index,
|
index,
|
||||||
cardsData: options.cardsData
|
cardsData: options.cardsData
|
||||||
});
|
});
|
||||||
emitEvent(options.app, options.cardsData.cards, type);
|
emitEvent(options.app, options.cardsData.cards[index + 1], type);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -410,9 +410,9 @@ export const bindCardEvent = async (options: {
|
|||||||
notebook: filterElement.getAttribute("data-id"),
|
notebook: filterElement.getAttribute("data-id"),
|
||||||
reviewedCards: options.cardsData.cards
|
reviewedCards: options.cardsData.cards
|
||||||
}, async (result) => {
|
}, async (result) => {
|
||||||
|
emitEvent(options.app, options.cardsData.cards[index - 1], type);
|
||||||
index = 0;
|
index = 0;
|
||||||
options.cardsData = result.data;
|
options.cardsData = result.data;
|
||||||
emitEvent(options.app, options.cardsData.cards, type);
|
|
||||||
for (let i = 0; i < options.app.plugins.length; i++) {
|
for (let i = 0; i < options.app.plugins.length; i++) {
|
||||||
options.cardsData = await options.app.plugins[i].updateCards(options.cardsData);
|
options.cardsData = await options.app.plugins[i].updateCards(options.cardsData);
|
||||||
}
|
}
|
||||||
@ -441,18 +441,18 @@ export const bindCardEvent = async (options: {
|
|||||||
index,
|
index,
|
||||||
cardsData: options.cardsData
|
cardsData: options.cardsData
|
||||||
});
|
});
|
||||||
emitEvent(options.app, options.cardsData.cards, type);
|
emitEvent(options.app, options.cardsData.cards[index - 1], type);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return editor;
|
return editor;
|
||||||
};
|
};
|
||||||
|
|
||||||
const emitEvent = (app: App, cards: ICard[], type: string) => {
|
const emitEvent = (app: App, card: ICard, type: string) => {
|
||||||
app.plugins.forEach(item => {
|
app.plugins.forEach(item => {
|
||||||
item.eventBus.emit("click-flashcard-action", {
|
item.eventBus.emit("click-flashcard-action", {
|
||||||
type,
|
type,
|
||||||
cards
|
card
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user