diff options
| author | Stanley Yip <stanley_yip@brown.edu> | 2020-05-23 22:27:06 -0700 |
|---|---|---|
| committer | Stanley Yip <stanley_yip@brown.edu> | 2020-05-23 22:27:06 -0700 |
| commit | 577e93f075e44277254f096ae8bf769a239ebd33 (patch) | |
| tree | 3b4562befa8124fb5b4d6294e3a94529a27fe30c /src/client/views/presentationview/PresElementBox.tsx | |
| parent | 1113da5f2db22bd2b2b457b1f5b183d7f1f2e68d (diff) | |
| parent | 19ababdb6098ac36358c86e43ad63ab3066b4663 (diff) | |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web
Diffstat (limited to 'src/client/views/presentationview/PresElementBox.tsx')
| -rw-r--r-- | src/client/views/presentationview/PresElementBox.tsx | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/client/views/presentationview/PresElementBox.tsx b/src/client/views/presentationview/PresElementBox.tsx index a2a6882b9..475fef5b2 100644 --- a/src/client/views/presentationview/PresElementBox.tsx +++ b/src/client/views/presentationview/PresElementBox.tsx @@ -100,12 +100,11 @@ export class PresElementBox extends ViewBoxBaseComponent<FieldViewProps, PresDoc e.stopPropagation(); this.rootDoc.presProgressivize = !this.rootDoc.presProgressivize; const rootTarget = Cast(this.rootDoc.presentationTargetDoc, Doc, null); - if (this.rootDoc.presProgressivize && !rootTarget?.lastTimecode) { - const docs = DocListCast(rootTarget[Doc.LayoutFieldKey(rootTarget)]); - rootTarget.currentTimecode = 0; - CollectionFreeFormDocumentView.setupKeyframes(docs, docs.length, this.presBox); - docs.forEach((d, i) => numberRange(docs.length - i).forEach(f => Cast(d["opacity-indexed"], listSpec("number"), [])[f + i] = 1)); - rootTarget.lastTimecode = docs.length - 1; + const docs = DocListCast(rootTarget[Doc.LayoutFieldKey(rootTarget)]); + if (this.rootDoc.presProgressivize) { + rootTarget.currentFrame = 0; + CollectionFreeFormDocumentView.setupKeyframes(docs, docs.length, true); + rootTarget.lastFrame = docs.length - 1; } } @@ -216,7 +215,10 @@ export class PresElementBox extends ViewBoxBaseComponent<FieldViewProps, PresDoc <strong className="presElementBox-name"> {`${this.indexInPres + 1}. ${this.targetDoc?.title}`} </strong> - <button className="presElementBox-closeIcon" onPointerDown={e => e.stopPropagation()} onClick={e => this.props.removeDocument?.(this.rootDoc)}>X</button> + <button className="presElementBox-closeIcon" onPointerDown={e => e.stopPropagation()} onClick={e => { + this.props.removeDocument?.(this.rootDoc); + e.stopPropagation(); + }}>X</button> <br /> </>} <div className="presElementBox-buttons"> |
