diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/nodes/trails/PresBox.tsx | 22 |
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 |