aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-01-13 11:36:17 -0500
committerbobzel <zzzman@gmail.com>2023-01-13 11:36:17 -0500
commitde02143333177a39851f60c540f5a75a303a1c48 (patch)
treebd8bb31da50ed183ecbad0d5e2e6112624fcc3b9 /src
parent603d3c0d500fd14dd732040d588fec0e91768729 (diff)
changed starting presentations to not advance to next slide immediately but treat the first slide as if a transition had been made to it.
Diffstat (limited to 'src')
-rw-r--r--src/client/views/nodes/trails/PresBox.tsx22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/client/views/nodes/trails/PresBox.tsx b/src/client/views/nodes/trails/PresBox.tsx
index c4935da35..a609b46e4 100644
--- a/src/client/views/nodes/trails/PresBox.tsx
+++ b/src/client/views/nodes/trails/PresBox.tsx
@@ -638,14 +638,13 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() {
startAutoPres = async (startSlide: number) => {
if (!this.childDocs.length) return;
this.layoutDoc.presStatus = PresStatus.Autoplay;
- this.startPresentation(startSlide + 1 === this.childDocs.length ? 0 : startSlide);
+ this.startPresentation(startSlide);
clearTimeout(this._presTimer);
const func = (itemIndex: number) => {
- if (itemIndex === this.next()) this.layoutDoc.presStatus = PresStatus.Manual;
- this._presTimer = setTimeout(
- () => this.layoutDoc.presStatus !== PresStatus.Manual && func(this.itemIndex),
- NumCast(this.activeItem.presDuration, this.activeItem.type === DocumentType.SCRIPTING ? 0 : 2500) + NumCast(this.activeItem.presTransition)
- );
+ this._presTimer = setTimeout(() => {
+ if (itemIndex === this.next()) this.layoutDoc.presStatus = PresStatus.Manual;
+ this.layoutDoc.presStatus !== PresStatus.Manual && func(this.itemIndex);
+ }, NumCast(this.activeItem.presDuration, this.activeItem.type === DocumentType.SCRIPTING ? 0 : 2500) + NumCast(this.activeItem.presTransition));
};
func(this.itemIndex);
};
@@ -1821,6 +1820,7 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() {
}
scrollFocus = () => {
+ this.gotoDocument(0);
this.startOrPause(false);
return undefined;
};
@@ -2073,13 +2073,9 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() {
@action
startOrPause = (makeActive = true) => {
- if (this.itemIndex + 1 === this.childDocs.length) {
- this.gotoDocument(0);
- } else {
- makeActive && this.updateCurrentPresentation();
- if (this.layoutDoc.presStatus === PresStatus.Manual || this.layoutDoc.presStatus === PresStatus.Edit) this.startAutoPres(this.itemIndex);
- else this.pauseAutoPres();
- }
+ makeActive && this.updateCurrentPresentation();
+ if (this.layoutDoc.presStatus === PresStatus.Manual || this.layoutDoc.presStatus === PresStatus.Edit) this.startAutoPres(this.itemIndex);
+ else this.pauseAutoPres();
};
@action