aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/views/linking/LinkFollowBox.tsx3
-rw-r--r--src/client/views/linking/LinkMenuItem.tsx26
-rw-r--r--src/client/views/nodes/FormattedTextBox.tsx2
3 files changed, 17 insertions, 14 deletions
diff --git a/src/client/views/linking/LinkFollowBox.tsx b/src/client/views/linking/LinkFollowBox.tsx
index 487281d50..061a4fa93 100644
--- a/src/client/views/linking/LinkFollowBox.tsx
+++ b/src/client/views/linking/LinkFollowBox.tsx
@@ -1,9 +1,10 @@
import { observable, computed, action, trace } from "mobx";
import React = require("react");
import { observer } from "mobx-react";
-import { FieldViewProps } from "../nodes/FieldView";
+import { FieldViewProps, FieldView } from "../nodes/FieldView";
@observer
export class LinkFollowBox extends React.Component<FieldViewProps> {
+ public static LayoutString() { return FieldView.LayoutString(LinkFollowBox); }
} \ No newline at end of file
diff --git a/src/client/views/linking/LinkMenuItem.tsx b/src/client/views/linking/LinkMenuItem.tsx
index 7dc0a9fcd..65516b374 100644
--- a/src/client/views/linking/LinkMenuItem.tsx
+++ b/src/client/views/linking/LinkMenuItem.tsx
@@ -1,12 +1,12 @@
import { library } from '@fortawesome/fontawesome-svg-core';
-import { faEdit, faEye, faTimes, faArrowRight, faChevronDown, faChevronUp } from '@fortawesome/free-solid-svg-icons';
+import { faEdit, faEye, faTimes, faArrowRight, faChevronDown, faChevronUp, faGlobeAsia } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { observer } from "mobx-react";
import { DocumentManager } from "../../util/DocumentManager";
import { undoBatch } from "../../util/UndoManager";
import './LinkMenu.scss';
import React = require("react");
-import { Doc, DocListCastAsync } from '../../../new_fields/Doc';
+import { Doc, DocListCastAsync, WidthSym } from '../../../new_fields/Doc';
import { StrCast, Cast, FieldValue, NumCast } from '../../../new_fields/Types';
import { observable, action } from 'mobx';
import { LinkManager } from '../../util/LinkManager';
@@ -138,27 +138,29 @@ export class LinkMenuItem extends React.Component<LinkMenuItemProps> {
SelectionManager.DeselectAll();
}
+ // DONE
// this will open a link next to the source doc
@undoBatch
openLinkInPlace = () => {
this.highlightDoc();
let alias = Doc.MakeAlias(this.props.destinationDoc);
- let y = this.props.sourceDoc.y;
- let x = this.props.sourceDoc.x;
- let parentView: any = undefined;
- let parentDoc: Doc = this.props.sourceDoc;
+ let y = NumCast(this.props.sourceDoc.y);
+ let x = NumCast(this.props.sourceDoc.x);
+
+ let width = NumCast(this.props.sourceDoc.width);
+ let height = NumCast(this.props.sourceDoc.height);
+
+ alias.x = x + width + 30;
+ alias.y = y;
+ alias.width = width;
+ alias.height = height;
SelectionManager.SelectedDocuments().map(dv => {
if (dv.props.Document === this.props.sourceDoc) {
- parentView = dv.props.ContainingCollectionView;
+ dv.props.addDocument && dv.props.addDocument(alias, false);
}
});
-
- if (parentView) {
- // console.log(parentDoc)
- console.log(parentView.props.addDocument);
- }
}
//set this to be the default link behavior, can be any of the above
diff --git a/src/client/views/nodes/FormattedTextBox.tsx b/src/client/views/nodes/FormattedTextBox.tsx
index 9ae092bad..9652a3a78 100644
--- a/src/client/views/nodes/FormattedTextBox.tsx
+++ b/src/client/views/nodes/FormattedTextBox.tsx
@@ -739,7 +739,7 @@ export class FormattedTextBox extends DocComponent<(FieldViewProps & FormattedTe
@action
tryUpdateHeight() {
if (this.props.Document.autoHeight && this._ref.current!.scrollHeight !== 0) {
- console.log("DT = " + this.props.Document.title + " " + this._ref.current!.clientHeight + " " + this._ref.current!.scrollHeight + " " + this._ref.current!.textContent);
+ // console.log("DT = " + this.props.Document.title + " " + this._ref.current!.clientHeight + " " + this._ref.current!.scrollHeight + " " + this._ref.current!.textContent);
let xf = this._ref.current!.getBoundingClientRect();
let scrBounds = this.props.ScreenToLocalTransform().transformBounds(0, 0, xf.width, this._ref.current!.textContent === "" ? 35 : this._ref.current!.scrollHeight);
let nh = this.props.Document.isTemplate ? 0 : NumCast(this.dataDoc.nativeHeight, 0);