增加阅读是pdf中高亮显示
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { config } from "../../../package.json";
|
||||
import { getLocaleID, getString } from "../../utils/locale";
|
||||
import { ChatView } from "./chatView";
|
||||
import { onItemPaneSectionToggle, prepareItemPaneBody } from "./itemPaneSection";
|
||||
|
||||
const views = new WeakMap<HTMLElement, ChatView>();
|
||||
|
||||
@@ -23,6 +24,7 @@ export function registerChatPane() {
|
||||
onInit: ({ body }) => {
|
||||
const doc = body.ownerDocument;
|
||||
if (doc) ensureStyles(doc);
|
||||
prepareItemPaneBody(body);
|
||||
},
|
||||
onDestroy: ({ body }) => {
|
||||
views.get(body)?.destroy();
|
||||
@@ -51,6 +53,13 @@ export function registerChatPane() {
|
||||
const view = new ChatView(doc, body, item);
|
||||
views.set(body, view);
|
||||
await view.mount();
|
||||
const section = body.closest("collapsible-section");
|
||||
if (section && !section.hasAttribute("open")) {
|
||||
onItemPaneSectionToggle({ body });
|
||||
}
|
||||
},
|
||||
onToggle: ({ body, event }) => {
|
||||
onItemPaneSectionToggle({ body, event });
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user