@netless/app-slide 0.2.45-alpha.1 → 0.2.45-alpha.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netless/app-slide",
3
- "version": "0.2.45-alpha.1",
3
+ "version": "0.2.45-alpha.2",
4
4
  "main": "dist/main.cjs.js",
5
5
  "module": "dist/main.es.js",
6
6
  "types": "dist/index.d.ts",
@@ -180,6 +180,12 @@ export class SlideDocsViewer {
180
180
  };
181
181
 
182
182
  protected onRenderEnd = () => {
183
+ // 1. There's no render end event on initial render.
184
+ // 2. The end event is fired before the page changed event.
185
+ // So in this callback we will do nothing and we do all "end" works in onPageChanged.
186
+ };
187
+
188
+ public onPageChanged = () => {
183
189
  this.$overlay.style.opacity = "";
184
190
  this.$whiteboardView.classList.remove(this.wrapClassName("wb-view-hidden"));
185
191
  };
package/src/index.ts CHANGED
@@ -131,6 +131,7 @@ const SlideApp: NetlessApp<Attributes, MagixEvents, AppOptions, AppResult> = {
131
131
  }
132
132
  log("[Slide] page to", page, synced ? "(synced)" : "");
133
133
  docsViewer.viewer.setPageIndex(page - 1);
134
+ docsViewer.onPageChanged();
134
135
  }
135
136
  };
136
137