mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-28 18:00:15 +01:00
📱 add ai and flashcard
This commit is contained in:
parent
557781e4a1
commit
4e313b8829
11 changed files with 835 additions and 689 deletions
14
app/src/mobile/util/model.ts
Normal file
14
app/src/mobile/util/model.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
export const openModel = (obj: {
|
||||
html: string,
|
||||
icon: string,
|
||||
title: string,
|
||||
bindEvent: (element: HTMLElement) => void
|
||||
}) => {
|
||||
const modelElement = document.getElementById("model")
|
||||
modelElement.style.top = "0";
|
||||
modelElement.querySelector(".toolbar__icon use").setAttribute("xlink:href", "#" + obj.icon);
|
||||
modelElement.querySelector(".toolbar__text").innerHTML = obj.title
|
||||
const modelMainElement = modelElement.querySelector("#modelMain") as HTMLElement;
|
||||
modelMainElement.innerHTML = obj.html;
|
||||
obj.bindEvent(modelMainElement);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue