aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/LightboxView.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-05-14 12:06:31 -0400
committerbobzel <zzzman@gmail.com>2023-05-14 12:06:31 -0400
commitcfd353baf7356024dc88c61289755dd6699ae9fd (patch)
tree971b25f07ff19cde5b3f40dc440e6dfa02944e18 /src/client/views/LightboxView.tsx
parent24f9e3ddefb1853cce3f3c51dfbe6183d88bce78 (diff)
parent42afc0250de658fc3e924864bfae5afb4edec335 (diff)
Merge branch 'master' into UI_Update_Eric_Ma
Diffstat (limited to 'src/client/views/LightboxView.tsx')
-rw-r--r--src/client/views/LightboxView.tsx44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/client/views/LightboxView.tsx b/src/client/views/LightboxView.tsx
index c18a89481..1b309a6be 100644
--- a/src/client/views/LightboxView.tsx
+++ b/src/client/views/LightboxView.tsx
@@ -31,7 +31,7 @@ type LightboxSavedState = {
panY: Opt<number>;
scale: Opt<number>;
scrollTop: Opt<number>;
- layoutKey: Opt<string>;
+ layout_fieldKey: Opt<string>;
};
@observer
export class LightboxView extends React.Component<LightboxViewProps> {
@@ -51,11 +51,11 @@ export class LightboxView extends React.Component<LightboxViewProps> {
static path: { doc: Opt<Doc>; target: Opt<Doc>; history: Opt<{ doc: Doc; target?: Doc }[]>; future: Opt<Doc[]>; saved: Opt<LightboxSavedState> }[] = [];
@action public static SetLightboxDoc(doc: Opt<Doc>, target?: Doc, future?: Doc[], layoutTemplate?: Doc | string) {
if (this.LightboxDoc && this.LightboxDoc !== doc && this._savedState) {
- if (this._savedState.panX !== undefined) this.LightboxDoc._panX = this._savedState.panX;
- if (this._savedState.panY !== undefined) this.LightboxDoc._panY = this._savedState.panY;
- if (this._savedState.scrollTop !== undefined) this.LightboxDoc._scrollTop = this._savedState.scrollTop;
- if (this._savedState.scale !== undefined) this.LightboxDoc._viewScale = this._savedState.scale;
- this.LightboxDoc.layoutKey = this._savedState.layoutKey;
+ if (this._savedState.panX !== undefined) this.LightboxDoc._freeform_panX = this._savedState.panX;
+ if (this._savedState.panY !== undefined) this.LightboxDoc._freeform_panY = this._savedState.panY;
+ if (this._savedState.scrollTop !== undefined) this.LightboxDoc._layout_scrollTop = this._savedState.scrollTop;
+ if (this._savedState.scale !== undefined) this.LightboxDoc._freeform_scale = this._savedState.scale;
+ this.LightboxDoc.layout_fieldKey = this._savedState.layout_fieldKey;
}
if (!doc) {
this._docFilters && (this._docFilters.length = 0);
@@ -64,17 +64,17 @@ export class LightboxView extends React.Component<LightboxViewProps> {
MainView.Instance._exploreMode = false;
} else {
const l = DocUtils.MakeLinkToActiveAudio(() => doc).lastElement();
- l && (Cast(l.anchor2, Doc, null).backgroundColor = 'lightgreen');
+ l && (Cast(l.link_anchor_2, Doc, null).backgroundColor = 'lightgreen');
CollectionStackedTimeline.CurrentlyPlaying?.forEach(dv => dv.ComponentView?.Pause?.());
//TabDocView.PinDoc(doc, { hidePresBox: true });
this._history ? this._history.push({ doc, target }) : (this._history = [{ doc, target }]);
if (doc !== LightboxView.LightboxDoc) {
this._savedState = {
- layoutKey: StrCast(doc.layoutKey),
- panX: Cast(doc.panX, 'number', null),
- panY: Cast(doc.panY, 'number', null),
- scale: Cast(doc.viewScale, 'number', null),
- scrollTop: Cast(doc.scrollTop, 'number', null),
+ layout_fieldKey: StrCast(doc.layout_fieldKey),
+ panX: Cast(doc.freeform_panX, 'number', null),
+ panY: Cast(doc.freeform_panY, 'number', null),
+ scale: Cast(doc.freeform_scale, 'number', null),
+ scrollTop: Cast(doc.layout_scrollTop, 'number', null),
};
}
}
@@ -91,7 +91,7 @@ export class LightboxView extends React.Component<LightboxViewProps> {
this._doc = doc;
this._layoutTemplate = layoutTemplate instanceof Doc ? layoutTemplate : undefined;
if (doc && (typeof layoutTemplate === 'string' ? layoutTemplate : undefined)) {
- doc.layoutKey = layoutTemplate;
+ doc.layout_fieldKey = layoutTemplate;
}
this._docTarget = target || doc;
@@ -142,7 +142,7 @@ export class LightboxView extends React.Component<LightboxViewProps> {
return LightboxView.SetLightboxDoc(
doc,
undefined,
- [...DocListCast(doc[Doc.LayoutFieldKey(doc)]), ...DocListCast(doc[Doc.LayoutFieldKey(doc) + '-annotations']).filter(anno => anno.annotationOn !== doc), ...(LightboxView._future ?? [])].sort(
+ [...DocListCast(doc[Doc.LayoutFieldKey(doc)]), ...DocListCast(doc[Doc.LayoutFieldKey(doc) + '_annotations']).filter(anno => anno.annotationOn !== doc), ...(LightboxView._future ?? [])].sort(
(a: Doc, b: Doc) => NumCast(b._timecodeToShow) - NumCast(a._timecodeToShow)
),
layoutTemplate
@@ -156,17 +156,17 @@ export class LightboxView extends React.Component<LightboxViewProps> {
const targetDocView = target && DocumentManager.Instance.getLightboxDocumentView(target);
if (targetDocView && target) {
const l = DocUtils.MakeLinkToActiveAudio(() => targetDocView.ComponentView?.getAnchor?.(true) || target).lastElement();
- l && (Cast(l.anchor2, Doc, null).backgroundColor = 'lightgreen');
+ l && (Cast(l.link_anchor_2, Doc, null).backgroundColor = 'lightgreen');
DocumentManager.Instance.showDocument(target, { willZoomCentered: true, zoomScale: 0.9 });
if (LightboxView._history?.lastElement().target !== target) LightboxView._history?.push({ doc, target });
} else {
if (!target && LightboxView.path.length) {
const saved = LightboxView._savedState;
if (LightboxView.LightboxDoc && saved) {
- LightboxView.LightboxDoc._panX = saved.panX;
- LightboxView.LightboxDoc._panY = saved.panY;
- LightboxView.LightboxDoc._viewScale = saved.scale;
- LightboxView.LightboxDoc._scrollTop = saved.scrollTop;
+ LightboxView.LightboxDoc._freeform_panX = saved.panX;
+ LightboxView.LightboxDoc._freeform_panY = saved.panY;
+ LightboxView.LightboxDoc._freeform_scale = saved.scale;
+ LightboxView.LightboxDoc._layout_scrollTop = saved.scrollTop;
}
const pop = LightboxView.path.pop();
if (pop) {
@@ -210,7 +210,7 @@ export class LightboxView extends React.Component<LightboxViewProps> {
const coll = LightboxView._docTarget;
if (coll) {
const fieldKey = Doc.LayoutFieldKey(coll);
- const contents = [...DocListCast(coll[fieldKey]), ...DocListCast(coll[fieldKey + '-annotations'])];
+ const contents = [...DocListCast(coll[fieldKey]), ...DocListCast(coll[fieldKey + '_annotations'])];
const links = LinkManager.Links(coll)
.map(link => LinkManager.getOppositeAnchor(link, coll))
.filter(doc => doc)
@@ -305,9 +305,9 @@ export class LightboxView extends React.Component<LightboxViewProps> {
title="toggle fit width"
onClick={e => {
e.stopPropagation();
- LightboxView.LightboxDoc!._fitWidth = !LightboxView.LightboxDoc!._fitWidth;
+ LightboxView.LightboxDoc!._layout_fitWidth = !LightboxView.LightboxDoc!._layout_fitWidth;
}}>
- <FontAwesomeIcon icon={LightboxView.LightboxDoc?._fitWidth ? 'arrows-alt-h' : 'arrows-alt-v'} size="2x" />
+ <FontAwesomeIcon icon={LightboxView.LightboxDoc?._layout_fitWidth ? 'arrows-alt-h' : 'arrows-alt-v'} size="2x" />
</div>
<div
className="lightboxView-tabBtn"