aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-10-08 23:08:35 -0400
committerbobzel <zzzman@gmail.com>2024-10-08 23:08:35 -0400
commitca67414c9da685070c1143ce3b771edda2fdc191 (patch)
tree3dd72b2d9e62f6af817cd7775585d0bb93cc40c0 /src
parent972839216c14baa5c9eaf80e1fb2fb2694bbb72c (diff)
parentb9fda86731a01ebfc3f21ebdd4eaf43a1c9eccc6 (diff)
Merge branch 'master' into alyssa-starter
Diffstat (limited to 'src')
-rw-r--r--src/client/util/SnappingManager.ts3
-rw-r--r--src/client/views/DocumentDecorations.tsx9
-rw-r--r--src/client/views/collections/CollectionCardDeckView.tsx4
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx2
4 files changed, 9 insertions, 9 deletions
diff --git a/src/client/util/SnappingManager.ts b/src/client/util/SnappingManager.ts
index 95ccc7735..5f6c7d9ac 100644
--- a/src/client/util/SnappingManager.ts
+++ b/src/client/util/SnappingManager.ts
@@ -28,6 +28,7 @@ export class SnappingManager {
@observable _lastBtnId: string = '';
@observable _propertyWid: number = 0;
@observable _printToConsole: boolean = false;
+ @observable _hideDecorations: boolean = false;
private constructor() {
SnappingManager._manager = this;
@@ -59,6 +60,7 @@ export class SnappingManager {
public static get LastPressedBtn() { return this.Instance._lastBtnId; } // prettier-ignore
public static get PropertiesWidth(){ return this.Instance._propertyWid; } // prettier-ignore
public static get PrintToConsole() { return this.Instance._printToConsole; } // prettier-ignore
+ public static get HideDecorations(){ return this.Instance._hideDecorations; } // prettier-ignore
public static SetLongPress = (press: boolean) => runInAction(() => {this.Instance._longPress = press}); // prettier-ignore
public static SetShiftKey = (down: boolean) => runInAction(() => {this.Instance._shiftKey = down}); // prettier-ignore
@@ -75,6 +77,7 @@ export class SnappingManager {
public static SetLastPressedBtn = (id:string) =>runInAction(() => {this.Instance._lastBtnId = id}); // prettier-ignore
public static SetPropertiesWidth= (wid:number) =>runInAction(() => {this.Instance._propertyWid = wid}); // prettier-ignore
public static SetPrintToConsole = (state:boolean) =>runInAction(() => {this.Instance._printToConsole = state}); // prettier-ignore
+ public static SetHideDecorations= (state:boolean) =>runInAction(() => {this.Instance._hideDecorations = state}); // prettier-ignore
public static userColor: string | undefined;
public static userVariantColor: string | undefined;
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx
index 1c0d51e17..62f2de776 100644
--- a/src/client/views/DocumentDecorations.tsx
+++ b/src/client/views/DocumentDecorations.tsx
@@ -63,7 +63,6 @@ export class DocumentDecorations extends ObservableReactComponent<DocumentDecora
@observable private _accumulatedTitle = '';
@observable private _titleControlString: string = '$title';
@observable private _editingTitle = false;
- @observable private _hidden = false;
@observable private _isRotating: boolean = false;
@observable private _isRounding: boolean = false;
@observable private _showLayoutAcl: boolean = false;
@@ -202,16 +201,14 @@ export class DocumentDecorations extends ObservableReactComponent<DocumentDecora
dragData.removeDocument = dragDocView._props.removeDocument;
dragData.isDocDecorationMove = true;
dragData.canEmbed = dragTitle;
- this._hidden = true;
+ SnappingManager.SetHideDecorations(true);
DragManager.StartDocumentDrag(
DocumentView.Selected().map(dv => dv.ContentDiv!),
dragData,
e.x,
e.y,
{
- dragComplete: action(() => {
- this._hidden = false;
- }),
+ dragComplete: () => SnappingManager.SetHideDecorations(false),
hideSource: true,
}
);
@@ -653,7 +650,7 @@ export class DocumentDecorations extends ObservableReactComponent<DocumentDecora
this._forceRender;
const { b, r, x, y } = this.Bounds;
const seldocview = DocumentView.Selected().lastElement();
- if (SnappingManager.IsDragging || r - x < 1 || x === Number.MAX_VALUE || !seldocview || this._hidden || isNaN(r) || isNaN(b) || isNaN(x) || isNaN(y)) {
+ if (SnappingManager.IsDragging || r - x < 1 || x === Number.MAX_VALUE || !seldocview || SnappingManager.HideDecorations || isNaN(r) || isNaN(b) || isNaN(x) || isNaN(y)) {
setTimeout(
action(() => {
this._editingTitle = false;
diff --git a/src/client/views/collections/CollectionCardDeckView.tsx b/src/client/views/collections/CollectionCardDeckView.tsx
index c61b0b4dd..5d39dc1ca 100644
--- a/src/client/views/collections/CollectionCardDeckView.tsx
+++ b/src/client/views/collections/CollectionCardDeckView.tsx
@@ -549,10 +549,10 @@ export class CollectionCardView extends CollectionSubView() {
} else {
// otherwise, turn off documentDecorations becase we're in a selection transition and want to avoid artifacts.
// Turn them back on when the animation has completed and the render and backend structures are in synch
- SnappingManager.SetIsResizing(doc[Id]);
+ SnappingManager.SetHideDecorations(true);
setTimeout(
action(() => {
- SnappingManager.SetIsResizing(undefined);
+ SnappingManager.SetHideDecorations(false);
this._forceChildXf++;
}),
1000
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index 0cc63d632..d8678eebc 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -138,7 +138,7 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection
return this._props.layoutEngine?.() || StrCast(this.layoutDoc._layoutEngine);
}
@computed get childPointerEvents() {
- return SnappingManager.IsResizing
+ return falseSnappingManager.IsResizing
? 'none'
: (this._props.childPointerEvents?.() ??
(this._props.viewDefDivClick || //