aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/views/DocumentDecorations.tsx10
-rw-r--r--src/client/views/PropertiesView.tsx4
-rw-r--r--src/client/views/StyleProvider.tsx1
-rw-r--r--src/client/views/collections/CollectionTreeView.tsx2
-rw-r--r--src/client/views/collections/TreeView.tsx2
-rw-r--r--src/client/views/nodes/FilterBox.tsx7
-rw-r--r--src/client/views/nodes/LinkDocPreview.tsx2
7 files changed, 14 insertions, 14 deletions
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx
index ce7ff1bbd..e23374cea 100644
--- a/src/client/views/DocumentDecorations.tsx
+++ b/src/client/views/DocumentDecorations.tsx
@@ -83,7 +83,7 @@ export class DocumentDecorations extends React.Component<{ boundsLeft: number, b
UndoManager.RunInBatch(() => titleFieldKey && SelectionManager.Views().forEach(d => {
titleFieldKey === "title" && (d.dataDoc["title-custom"] = !this._accumulatedTitle.startsWith("-"));
//@ts-ignore
- Doc.SetInPlace(d.rootDoc, titleFieldKey, +this._accumulatedTitle == this._accumulatedTitle ? +this._accumulatedTitle : this._accumulatedTitle, true);
+ Doc.SetInPlace(d.rootDoc, titleFieldKey, +this._accumulatedTitle === this._accumulatedTitle ? +this._accumulatedTitle : this._accumulatedTitle, true);
}), "title blur");
}
}
@@ -376,10 +376,10 @@ export class DocumentDecorations extends React.Component<{ boundsLeft: number, b
this._inkDragDocs.map(oldbds => ({ oldbds, inkPts: Cast(oldbds.doc.data, InkField)?.inkData || [] }))
.forEach(({ oldbds: { doc, x, y, width, height }, inkPts }) => {
Doc.GetProto(doc).data = new InkField(inkPts.map(ipt => // (new x — oldx) + newWidth * (oldxpoint /oldWidth)
- ({
- X: (NumCast(doc.x) - x) + NumCast(doc.width) * ipt.X / width,
- Y: (NumCast(doc.y) - y) + NumCast(doc.height) * ipt.Y / height
- })));
+ ({
+ X: (NumCast(doc.x) - x) + NumCast(doc.width) * ipt.X / width,
+ Y: (NumCast(doc.y) - y) + NumCast(doc.height) * ipt.Y / height
+ })));
Doc.SetNativeWidth(doc, undefined);
Doc.SetNativeHeight(doc, undefined);
});
diff --git a/src/client/views/PropertiesView.tsx b/src/client/views/PropertiesView.tsx
index df4dd7788..782a0e29e 100644
--- a/src/client/views/PropertiesView.tsx
+++ b/src/client/views/PropertiesView.tsx
@@ -951,7 +951,7 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
!this.openFilters ? (null) :
<div className="propertiesView-filters-content" style={{ height: this.filterDoc.currentFilter[HeightSym]() + 15 }}>
<DocumentView
- Document={this.filterDoc.currentFilter as Doc}
+ Document={this.filterDoc.currentFilter}
DataDoc={undefined}
addDocument={undefined}
addDocTab={returnFalse}
@@ -962,7 +962,7 @@ export class PropertiesView extends React.Component<PropertiesViewProps> {
PanelWidth={() => this.props.width}
PanelHeight={this.filterDoc.currentFilter[HeightSym]}
renderDepth={0}
- scriptContext={this.filterDoc.currentFilter as Doc}
+ scriptContext={this.filterDoc.currentFilter}
focus={emptyFunction}
styleProvider={DefaultStyleProvider}
isContentActive={returnTrue}
diff --git a/src/client/views/StyleProvider.tsx b/src/client/views/StyleProvider.tsx
index d1e2fefcb..3853d5888 100644
--- a/src/client/views/StyleProvider.tsx
+++ b/src/client/views/StyleProvider.tsx
@@ -18,6 +18,7 @@ import "./collections/TreeView.scss";
import "./nodes/FilterBox.scss";
import React = require("react");
import Color = require('color');
+import { FieldViewProps } from './nodes/FieldView';
export enum StyleLayers {
Background = "background"
diff --git a/src/client/views/collections/CollectionTreeView.tsx b/src/client/views/collections/CollectionTreeView.tsx
index a9e73583d..959864a60 100644
--- a/src/client/views/collections/CollectionTreeView.tsx
+++ b/src/client/views/collections/CollectionTreeView.tsx
@@ -59,7 +59,7 @@ export class CollectionTreeView extends CollectionSubView<Document, Partial<coll
componentWillMount() {
this._disposers.autoheight = reaction(() => this.rootDoc.autoHeight,
auto => auto && this.computeHeight(),
- { fireImmediately: true })
+ { fireImmediately: true });
}
refList: Set<any> = new Set();
diff --git a/src/client/views/collections/TreeView.tsx b/src/client/views/collections/TreeView.tsx
index 2c3a6c0d7..5df33afe0 100644
--- a/src/client/views/collections/TreeView.tsx
+++ b/src/client/views/collections/TreeView.tsx
@@ -174,7 +174,7 @@ export class TreeView extends React.Component<TreeViewProps> {
componentWillUnmount() {
this._selDisposer?.();
- this._treeEle && this.props.unobserveHeight(this._treeEle)
+ this._treeEle && this.props.unobserveHeight(this._treeEle);
document.removeEventListener("pointermove", this.onDragMove, true);
document.removeEventListener("pointermove", this.onDragUp, true);
}
diff --git a/src/client/views/nodes/FilterBox.tsx b/src/client/views/nodes/FilterBox.tsx
index ae5b79aec..30d7ed187 100644
--- a/src/client/views/nodes/FilterBox.tsx
+++ b/src/client/views/nodes/FilterBox.tsx
@@ -82,9 +82,8 @@ export class FilterBox extends ViewBoxBaseComponent<FieldViewProps, FilterBoxDoc
* @returns the relevant doc according to the value of FilterBox._filterScope i.e. either the Current Dashboard or the Current Collection
*/
@computed static get targetDoc() {
- console.log("recomputing");
if (FilterBox._filterScope === "Current Collection") {
- return SelectionManager.Views()[0]?.Document.type === "collection" ? SelectionManager.Views()[0].Document : SelectionManager.Views()[0]?.props.ContainingCollectionDoc!;
+ return SelectionManager.Views()[0]?.Document.type === DocumentType.COL ? SelectionManager.Views()[0].Document : SelectionManager.Views()[0]?.props.ContainingCollectionDoc!;
}
else return CurrentUserUtils.ActiveDashboard;
}
@@ -172,10 +171,10 @@ export class FilterBox extends ViewBoxBaseComponent<FieldViewProps, FilterBoxDoc
public removeFilter = (filterName: string) => {
const targetDoc = FilterBox.targetDoc;
const filterDoc = targetDoc.currentFilter as Doc;
- const attributes = DocListCast(filterDoc["data"]);
+ const attributes = DocListCast(filterDoc.data);
const found = attributes.findIndex(doc => doc.title === filterName);
if (found !== -1) {
- (filterDoc["data"] as List<Doc>).splice(found, 1);
+ (filterDoc.data as List<Doc>).splice(found, 1);
const docFilter = Cast(targetDoc._docFilters, listSpec("string"));
if (docFilter) {
let index: number;
diff --git a/src/client/views/nodes/LinkDocPreview.tsx b/src/client/views/nodes/LinkDocPreview.tsx
index 45e3c8382..b73fb10df 100644
--- a/src/client/views/nodes/LinkDocPreview.tsx
+++ b/src/client/views/nodes/LinkDocPreview.tsx
@@ -26,7 +26,7 @@ interface LinkDocPreviewProps {
@observer
export class LinkDocPreview extends React.Component<LinkDocPreviewProps> {
@action public static Clear() { LinkDocPreview.LinkInfo = undefined; }
- @action public static SetLinkInfo(info?: LinkDocPreviewProps) { LinkDocPreview.LinkInfo != info && (LinkDocPreview.LinkInfo = info); }
+ @action public static SetLinkInfo(info?: LinkDocPreviewProps) { LinkDocPreview.LinkInfo !== info && (LinkDocPreview.LinkInfo = info); }
_infoRef = React.createRef<HTMLDivElement>();
@observable public static LinkInfo: Opt<LinkDocPreviewProps>;