mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-19 10:30:45 +08:00
This commit is contained in:
parent
e90f594737
commit
f4e030b9eb
@ -25,6 +25,9 @@ export const newCardModel = (options: {
|
|||||||
data: options.data,
|
data: options.data,
|
||||||
async init() {
|
async init() {
|
||||||
if (options.data.cardsData) {
|
if (options.data.cardsData) {
|
||||||
|
for (let i = 0; i < options.app.plugins.length; i++) {
|
||||||
|
options.data.cardsData = await options.app.plugins[i].updateCards(options.data.cardsData);
|
||||||
|
}
|
||||||
this.element.innerHTML = genCardHTML({
|
this.element.innerHTML = genCardHTML({
|
||||||
id: this.data.id,
|
id: this.data.id,
|
||||||
cardType: this.data.cardType,
|
cardType: this.data.cardType,
|
||||||
@ -52,6 +55,9 @@ export const newCardModel = (options: {
|
|||||||
deckID: this.data.id,
|
deckID: this.data.id,
|
||||||
notebook: this.data.id,
|
notebook: this.data.id,
|
||||||
}, async (response) => {
|
}, async (response) => {
|
||||||
|
for (let i = 0; i < options.app.plugins.length; i++) {
|
||||||
|
options.data.cardsData = await options.app.plugins[i].updateCards(options.data.cardsData);
|
||||||
|
}
|
||||||
this.element.innerHTML = genCardHTML({
|
this.element.innerHTML = genCardHTML({
|
||||||
id: this.data.id,
|
id: this.data.id,
|
||||||
cardType: this.data.cardType,
|
cardType: this.data.cardType,
|
||||||
@ -87,7 +93,10 @@ export const newCardModel = (options: {
|
|||||||
rootID: this.data.id,
|
rootID: this.data.id,
|
||||||
deckID: this.data.id,
|
deckID: this.data.id,
|
||||||
notebook: this.data.id,
|
notebook: this.data.id,
|
||||||
}, (response) => {
|
}, async (response) => {
|
||||||
|
for (let i = 0; i < options.app.plugins.length; i++) {
|
||||||
|
options.data.cardsData = await options.app.plugins[i].updateCards(options.data.cardsData);
|
||||||
|
}
|
||||||
this.element.innerHTML = genCardHTML({
|
this.element.innerHTML = genCardHTML({
|
||||||
id: this.data.id,
|
id: this.data.id,
|
||||||
cardType: this.data.cardType,
|
cardType: this.data.cardType,
|
||||||
|
@ -132,9 +132,6 @@ export const bindCardEvent = async (options: {
|
|||||||
dialog?: Dialog,
|
dialog?: Dialog,
|
||||||
index?: number
|
index?: number
|
||||||
}) => {
|
}) => {
|
||||||
for (let i = 0; i < options.app.plugins.length; i++) {
|
|
||||||
options.cardsData = await options.app.plugins[i].updateCards(options.cardsData);
|
|
||||||
}
|
|
||||||
if (window.siyuan.storage[Constants.LOCAL_FLASHCARD].fullscreen) {
|
if (window.siyuan.storage[Constants.LOCAL_FLASHCARD].fullscreen) {
|
||||||
fullscreen(options.element.querySelector(".card__main"),
|
fullscreen(options.element.querySelector(".card__main"),
|
||||||
options.element.querySelector('[data-type="fullscreen"]'));
|
options.element.querySelector('[data-type="fullscreen"]'));
|
||||||
@ -467,6 +464,9 @@ export const openCardByData = async (app: App, cardsData: ICardData, cardType: T
|
|||||||
if (getSelection().rangeCount > 0) {
|
if (getSelection().rangeCount > 0) {
|
||||||
lastRange = getSelection().getRangeAt(0);
|
lastRange = getSelection().getRangeAt(0);
|
||||||
}
|
}
|
||||||
|
for (let i = 0; i < app.plugins.length; i++) {
|
||||||
|
cardsData = await app.plugins[i].updateCards(cardsData);
|
||||||
|
}
|
||||||
const dialog = new Dialog({
|
const dialog = new Dialog({
|
||||||
positionId: Constants.DIALOG_OPENCARD,
|
positionId: Constants.DIALOG_OPENCARD,
|
||||||
content: genCardHTML({id, cardType, cardsData, isTab: false}),
|
content: genCardHTML({id, cardType, cardsData, isTab: false}),
|
||||||
|
Loading…
Reference in New Issue
Block a user