aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/trails
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2025-03-16 21:33:59 -0400
committerbobzel <zzzman@gmail.com>2025-03-16 21:33:59 -0400
commit35f7b94e59f72463a30a52dd0fd8b57288b79016 (patch)
tree66ed024d42a63844837f1f27a0cb3c8e5273b7fb /src/client/views/nodes/trails
parent1ffa8a8fb3e16bd5a3338d18782ddda0c2ffca03 (diff)
parent920fb858854ca4866edc838b1db458ec7645f021 (diff)
Merge branch 'master' into DocCreatorMenu-work
Diffstat (limited to 'src/client/views/nodes/trails')
-rw-r--r--src/client/views/nodes/trails/PresBox.tsx1
-rw-r--r--src/client/views/nodes/trails/PresElementBox.tsx10
2 files changed, 7 insertions, 4 deletions
diff --git a/src/client/views/nodes/trails/PresBox.tsx b/src/client/views/nodes/trails/PresBox.tsx
index 9ab5fb1bd..f818c6e20 100644
--- a/src/client/views/nodes/trails/PresBox.tsx
+++ b/src/client/views/nodes/trails/PresBox.tsx
@@ -210,6 +210,7 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() {
}
componentDidMount() {
+ this._props.setContentViewBox?.(this);
this._disposers.pause = reaction(
() => SnappingManager.UserPanned,
() => this.pauseAutoPres()
diff --git a/src/client/views/nodes/trails/PresElementBox.tsx b/src/client/views/nodes/trails/PresElementBox.tsx
index b0732c281..31cd1603f 100644
--- a/src/client/views/nodes/trails/PresElementBox.tsx
+++ b/src/client/views/nodes/trails/PresElementBox.tsx
@@ -52,7 +52,11 @@ export class PresElementBox extends ViewBoxBaseComponent<FieldViewProps>() {
// the presentation view that renders this slide
@computed get presBoxView() {
- return this.DocumentView?.().containerViewPath?.().lastElement()?.ComponentView as PresBox;
+ return this.DocumentView?.()
+ .containerViewPath?.()
+ .slice()
+ .reverse()
+ .find(dv => dv?.ComponentView instanceof PresBox)?.ComponentView as PresBox;
}
// the presentation view document that renders this slide
@@ -235,9 +239,7 @@ export class PresElementBox extends ViewBoxBaseComponent<FieldViewProps>() {
e.clientY,
undefined,
action(() => {
- Array.from(classesToRestore).forEach(pair => {
- pair[0].className = pair[1];
- });
+ Array.from(classesToRestore).forEach(pair => (pair[0].className = pair[1]));
this._dragging = false;
})
);