From de02143333177a39851f60c540f5a75a303a1c48 Mon Sep 17 00:00:00 2001 From: bobzel Date: Fri, 13 Jan 2023 11:36:17 -0500 Subject: changed starting presentations to not advance to next slide immediately but treat the first slide as if a transition had been made to it. --- src/client/views/nodes/trails/PresBox.tsx | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'src') 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() { 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() { } scrollFocus = () => { + this.gotoDocument(0); this.startOrPause(false); return undefined; }; @@ -2073,13 +2073,9 @@ export class PresBox extends ViewBoxBaseComponent() { @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 -- cgit v1.2.3-70-g09d2