增加阅读是pdf中高亮显示
This commit is contained in:
@@ -2,6 +2,10 @@ import { config } from "../../../../package.json";
|
||||
import { getLocaleID, getString } from "../../../utils/locale";
|
||||
import { findPdfAttachment } from "../../pdf/extractor";
|
||||
import { ensureChatPapersStyles } from "../../ui/readerPane";
|
||||
import {
|
||||
onItemPaneSectionToggle,
|
||||
prepareItemPaneBody,
|
||||
} from "../../ui/itemPaneSection";
|
||||
import { LecturePaneView } from "./lecturePane";
|
||||
|
||||
const views = new WeakMap<HTMLElement, LecturePaneView>();
|
||||
@@ -25,6 +29,7 @@ export function registerLecturePane() {
|
||||
onInit: ({ body }) => {
|
||||
const doc = body.ownerDocument;
|
||||
if (doc) ensureChatPapersStyles(doc);
|
||||
prepareItemPaneBody(body);
|
||||
},
|
||||
onDestroy: ({ body }) => {
|
||||
views.get(body)?.destroy();
|
||||
@@ -60,6 +65,13 @@ export function registerLecturePane() {
|
||||
err.textContent = getString("lecture-mount-error");
|
||||
body.append(err);
|
||||
}
|
||||
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