aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenny Yu <jennyyu212@outlook.com>2022-05-03 16:43:02 -0400
committerJenny Yu <jennyyu212@outlook.com>2022-05-03 16:43:02 -0400
commit4381f14cfc058c534d4117a61ece34c6db72da9d (patch)
tree8db7bc9144148afe17cb736dcc7011bece3f197b
parent416d9a1ef143cffed341fdb390a245b82c4b4137 (diff)
feat: close recording when deleting slides
-rw-r--r--src/client/views/nodes/trails/PresElementBox.tsx8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/client/views/nodes/trails/PresElementBox.tsx b/src/client/views/nodes/trails/PresElementBox.tsx
index bc1cea505..23c80253c 100644
--- a/src/client/views/nodes/trails/PresElementBox.tsx
+++ b/src/client/views/nodes/trails/PresElementBox.tsx
@@ -234,6 +234,7 @@ export class PresElementBox extends ViewBoxBaseComponent<FieldViewProps>() {
if (PresBox.Instance._selectedArray.has(this.rootDoc)) {
PresBox.Instance._selectedArray.delete(this.rootDoc);
}
+ this.hideRecording();
e.stopPropagation();
});
@@ -285,10 +286,10 @@ export class PresElementBox extends ViewBoxBaseComponent<FieldViewProps>() {
@undoBatch
@action
- hideRecording = (targetDoc: Doc, activeItem: Doc) => {
+ hideRecording = () => {
console.log("hide recording")
DocListCast((Doc.UserDoc().myOverlayDocs as Doc).data).forEach((doc) => {
- if (doc.slides === activeItem) {
+ if (doc.slides === this.rootDoc) {
Doc.RemoveDocFromList((Doc.UserDoc().myOverlayDocs as Doc), undefined, doc);
}
})
@@ -322,6 +323,7 @@ export class PresElementBox extends ViewBoxBaseComponent<FieldViewProps>() {
const pt = this.props.ScreenToLocalTransform().inverse().transformPoint(0, 0);
recording.x = pt[0];
recording.y = pt[1];
+ console.log(pt)
Doc.AddDocToList((Doc.UserDoc().myOverlayDocs as Doc), undefined, recording);
}
}
@@ -404,7 +406,7 @@ export class PresElementBox extends ViewBoxBaseComponent<FieldViewProps>() {
{this.recordingIsInOverlay ?
<Tooltip title={<><div className="dash-tooltip">{"Hide Recording"}</div></>}>
<div className="slideButton"
- onClick={() => this.hideRecording(targetDoc, activeItem)}
+ onClick={this.hideRecording}
style={{ fontWeight: 700 }}>
<FontAwesomeIcon icon={"video-slash"} onPointerDown={e => e.stopPropagation()} />
</div>