aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/trails
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-02-22 21:06:34 -0500
committerbobzel <zzzman@gmail.com>2023-02-22 21:06:34 -0500
commitac8a292b2ac077cb530b926824594efab2228a16 (patch)
treed7509392b2b6b8c2d303c4402ae4882e8ebc796c /src/client/views/nodes/trails
parentb6cab6b3c47751b1d77297b7d150d8f227524592 (diff)
fixed hiding doc decorations when clicking on a nested doc. finished removing old view spec code in favor of saving and restoring anchor data.
Diffstat (limited to 'src/client/views/nodes/trails')
-rw-r--r--src/client/views/nodes/trails/PresBox.tsx25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/client/views/nodes/trails/PresBox.tsx b/src/client/views/nodes/trails/PresBox.tsx
index 32fcc0fae..4abdaeeb4 100644
--- a/src/client/views/nodes/trails/PresBox.tsx
+++ b/src/client/views/nodes/trails/PresBox.tsx
@@ -49,6 +49,7 @@ export interface PinProps {
scrollable?: boolean | undefined;
pannable?: boolean | undefined;
viewType?: boolean | undefined;
+ filters?: boolean | undefined;
temporal?: boolean | undefined;
clippable?: boolean | undefined;
dataview?: boolean | undefined;
@@ -317,7 +318,18 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() {
this.onHideDocument(); //Handles hide after/before
}
});
- static pinDataTypes(target?: Doc): { scrollable?: boolean; pannable?: boolean; viewType?: boolean; temporal?: boolean; clippable?: boolean; dataview?: boolean; textview?: boolean; poslayoutview?: boolean; dataannos?: boolean } {
+ static pinDataTypes(target?: Doc): {
+ scrollable?: boolean;
+ pannable?: boolean;
+ viewType?: boolean;
+ filters?: boolean;
+ temporal?: boolean;
+ clippable?: boolean;
+ dataview?: boolean;
+ textview?: boolean;
+ poslayoutview?: boolean;
+ dataannos?: boolean;
+ } {
const targetType = target?.type as any;
const scrollable = [DocumentType.PDF, DocumentType.RTF, DocumentType.WEB].includes(targetType) || target?._viewType === CollectionViewType.Stacking;
const pannable = [DocumentType.IMG, DocumentType.PDF].includes(targetType) || (targetType === DocumentType.COL && target?._viewType === CollectionViewType.Freeform);
@@ -327,8 +339,9 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() {
const poslayoutview = [DocumentType.COL].includes(targetType) && target?.activeFrame === undefined;
const textview = [DocumentType.RTF].includes(targetType) && target?.activeFrame === undefined;
const viewType = targetType === DocumentType.COL;
+ const filters = true;
const dataannos = false;
- return { scrollable, pannable, viewType, temporal, clippable, dataview, textview, poslayoutview, dataannos };
+ return { scrollable, pannable, viewType, filters, temporal, clippable, dataview, textview, poslayoutview, dataannos };
}
@action
@@ -375,6 +388,13 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() {
}
}
+ if (pinDataTypes.filters && activeItem.presPinDocFilters !== undefined) {
+ if (bestTarget.docFilters !== activeItem.presPinDocFilters) {
+ bestTarget.docFilters = ObjectField.MakeCopy(activeItem.presPinDocFilters as ObjectField) || new List<string>([]);
+ changed = true;
+ }
+ }
+
if (pinDataTypes.scrollable) {
if (bestTarget._scrollTop !== activeItem.presPinViewScroll) {
bestTarget._scrollTop = activeItem.presPinViewScroll;
@@ -483,6 +503,7 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() {
if (pinProps.pinData.clippable) pinDoc.presPinClipWidth = targetDoc._clipWidth;
if (pinProps.pinData.poslayoutview) pinDoc.presPinLayoutData = new List<string>(DocListCast(targetDoc.presData).map(d => JSON.stringify({ id: d[Id], x: NumCast(d.x), y: NumCast(d.y), w: NumCast(d._width), h: NumCast(d._height) })));
if (pinProps.pinData.viewType) pinDoc.presPinViewType = targetDoc._viewType;
+ if (pinProps.pinData.filters) pinDoc.presPinDocFilters = ObjectField.MakeCopy(targetDoc.docFilters as ObjectField);
if (pinProps.pinData.pannable) {
pinDoc.presPinViewX = NumCast(targetDoc._panX);
pinDoc.presPinViewY = NumCast(targetDoc._panY);