@netless/app-slide 0.2.14 → 0.2.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.cjs.js +2 -2
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.es.js +7 -11
- package/dist/main.es.js.map +1 -1
- package/dist/main.iife.js +2 -2
- package/dist/main.iife.js.map +1 -1
- package/package.json +1 -1
- package/src/DocsViewer/index.ts +5 -7
package/package.json
CHANGED
package/src/DocsViewer/index.ts
CHANGED
|
@@ -71,6 +71,7 @@ export class DocsViewer {
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
public destroy(): void {
|
|
74
|
+
this.previewLazyLoad?.destroy();
|
|
74
75
|
this.sideEffect.flushAll();
|
|
75
76
|
this.unmount();
|
|
76
77
|
}
|
|
@@ -126,13 +127,6 @@ export class DocsViewer {
|
|
|
126
127
|
const $preview = document.createElement("div");
|
|
127
128
|
$preview.className = this.wrapClassName("preview") + " tele-fancy-scrollbar";
|
|
128
129
|
this.$preview = $preview;
|
|
129
|
-
this.sideEffect.add(() => {
|
|
130
|
-
this.previewLazyLoad = new LazyLoad({
|
|
131
|
-
container: this.$preview,
|
|
132
|
-
elements_selector: `.${this.wrapClassName("preview-page>img")}`,
|
|
133
|
-
});
|
|
134
|
-
return () => this.previewLazyLoad?.destroy();
|
|
135
|
-
});
|
|
136
130
|
|
|
137
131
|
this.refreshPreview();
|
|
138
132
|
|
|
@@ -347,6 +341,10 @@ export class DocsViewer {
|
|
|
347
341
|
"." + this.wrapClassName(`preview-page-${this.pageIndex}`)
|
|
348
342
|
);
|
|
349
343
|
if ($previewPage) {
|
|
344
|
+
this.previewLazyLoad ||= new LazyLoad({
|
|
345
|
+
container: this.$preview,
|
|
346
|
+
elements_selector: `.${this.wrapClassName("preview-page>img")}`,
|
|
347
|
+
});
|
|
350
348
|
this.$preview.scrollTo({
|
|
351
349
|
top: $previewPage.offsetTop - 16,
|
|
352
350
|
});
|