diff options
| author | bobzel <zzzman@gmail.com> | 2022-06-06 01:32:36 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2022-06-06 01:32:36 -0400 |
| commit | b0408fa264fc8a017c87a17325600d8e458fe711 (patch) | |
| tree | c331037af977150c240a2d4aa710a11e743c758b /src/client/views/nodes/AudioBox.tsx | |
| parent | 2d44289452af97b3ce860e3c174876ecbae465fe (diff) | |
fixed up overlayDocs a bit so that they can be removed. made audioBox's appear in overlay when clicked from toolbar. add links to audio when navigating to doc in lightbox.
Diffstat (limited to 'src/client/views/nodes/AudioBox.tsx')
| -rw-r--r-- | src/client/views/nodes/AudioBox.tsx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/client/views/nodes/AudioBox.tsx b/src/client/views/nodes/AudioBox.tsx index 9b92762a2..787ad939d 100644 --- a/src/client/views/nodes/AudioBox.tsx +++ b/src/client/views/nodes/AudioBox.tsx @@ -350,7 +350,14 @@ export class AudioBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProp Doc.GetProto(newDoc).recordingSource = this.dataDoc; Doc.GetProto(newDoc).recordingStart = ComputedField.MakeFunction(`self.recordingSource["${this.fieldKey}-recordingStart"]`); Doc.GetProto(newDoc).mediaState = ComputedField.MakeFunction("self.recordingSource.mediaState"); - this.props.addDocument?.(newDoc); + const overlayDoc = Doc.UserDoc().myOverlayDocs as Doc; + if (DocListCast(overlayDoc[Doc.LayoutFieldKey(overlayDoc)]).includes(this.rootDoc)) { + newDoc.x = this.rootDoc.x; + newDoc.y = NumCast(this.rootDoc.y) + NumCast(this.rootDoc._height); + Doc.AddDocToList(overlayDoc, undefined, newDoc); + } else { + this.props.addDocument?.(newDoc); + } e.stopPropagation(); } |
