@netless/forge-slide 0.1.1-alpha.1 → 0.1.1-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
package/src/SlideApplication.ts
CHANGED
|
@@ -48,6 +48,7 @@ export class SlideApplication extends AbstractApplication<SlideApplicationOption
|
|
|
48
48
|
private currentSlideIndex: number = 0;
|
|
49
49
|
private taskId: string = "";
|
|
50
50
|
private prefix: string = "";
|
|
51
|
+
private slideCount: number = 0;
|
|
51
52
|
|
|
52
53
|
constructor() {
|
|
53
54
|
super();
|
|
@@ -68,7 +69,7 @@ export class SlideApplication extends AbstractApplication<SlideApplicationOption
|
|
|
68
69
|
this.footer = new FooterView();
|
|
69
70
|
this.sideBar = new SideBarView();
|
|
70
71
|
this.sideBar.on("pageChange", index => {
|
|
71
|
-
if (index > 0 && index <= this.
|
|
72
|
+
if (index > 0 && index <= this.slideCount) {
|
|
72
73
|
this.slide.renderSlide(index);
|
|
73
74
|
}
|
|
74
75
|
});
|
|
@@ -110,7 +111,7 @@ export class SlideApplication extends AbstractApplication<SlideApplicationOption
|
|
|
110
111
|
if (!this.permissions.hasPermission(ForgeSlidePermissionFlag.changePage)) {
|
|
111
112
|
return;
|
|
112
113
|
}
|
|
113
|
-
if (this.currentSlideIndex < this.
|
|
114
|
+
if (this.currentSlideIndex < this.slideCount) {
|
|
114
115
|
this.slide.renderSlide(this.currentSlideIndex + 1);
|
|
115
116
|
}
|
|
116
117
|
});
|
|
@@ -327,7 +328,7 @@ export class SlideApplication extends AbstractApplication<SlideApplicationOption
|
|
|
327
328
|
whiteboardApp.applicationManager = this.applicationManager;
|
|
328
329
|
|
|
329
330
|
const json = await fetch(`${option.prefix}/${option.taskId}/jsonOutput/slide-1.json`).then(res => res.json())
|
|
330
|
-
|
|
331
|
+
this.slideCount = json.slideCount;
|
|
331
332
|
await whiteboardApp.initialize({
|
|
332
333
|
width: json.width,
|
|
333
334
|
height: json.height,
|
|
@@ -416,11 +417,10 @@ export class SlideApplication extends AbstractApplication<SlideApplicationOption
|
|
|
416
417
|
|
|
417
418
|
const syncSlide = this.getMap(this.name).get("slideState");
|
|
418
419
|
if (syncSlide && syncSlide.taskId === option.taskId) {
|
|
419
|
-
|
|
420
|
+
this.slide.setSlideState(syncSlide)
|
|
420
421
|
} else {
|
|
421
422
|
this.slide.renderSlide(1);
|
|
422
423
|
}
|
|
423
|
-
|
|
424
424
|
this.permissions = new ForgeSlidePermissions(this.userManager, (userId: string) => {
|
|
425
425
|
return this.userMap(userId);
|
|
426
426
|
});
|