aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/linking
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2022-12-16 15:07:50 -0500
committerbobzel <zzzman@gmail.com>2022-12-16 15:07:50 -0500
commit403d1c4fece9efa663e0fd7161afff9f27cf670c (patch)
tree8287d487c4373655e6012d978a4af81058e6dc8d /src/client/views/linking
parent61683e5e084f0b3a6c53bde08295a25b53ea2db3 (diff)
fixed problem with undo. regularized all linkfollowing anchor fields to start with followLink<xxx>. added ease vs linear flag for scroll transitions in link and preselmeent navigations. added link follow to move target to specified offset from source. shifted from setting dropAction on items to setting childDropAction on collections
Diffstat (limited to 'src/client/views/linking')
-rw-r--r--src/client/views/linking/LinkPopup.scss5
-rw-r--r--src/client/views/linking/LinkPopup.tsx13
2 files changed, 9 insertions, 9 deletions
diff --git a/src/client/views/linking/LinkPopup.scss b/src/client/views/linking/LinkPopup.scss
index 60c9ebfcd..b20ad9476 100644
--- a/src/client/views/linking/LinkPopup.scss
+++ b/src/client/views/linking/LinkPopup.scss
@@ -1,7 +1,7 @@
.linkPopup-container {
background: white;
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23);
- top: 35px;
+ top: 0;
height: 200px;
width: 200px;
position: absolute;
@@ -38,8 +38,7 @@
}
}
-
.searchBox-container {
background: pink;
}
-} \ No newline at end of file
+}
diff --git a/src/client/views/linking/LinkPopup.tsx b/src/client/views/linking/LinkPopup.tsx
index 0bcb68f82..7bdace2b6 100644
--- a/src/client/views/linking/LinkPopup.tsx
+++ b/src/client/views/linking/LinkPopup.tsx
@@ -11,10 +11,13 @@ import { SearchBox } from '../search/SearchBox';
import { DefaultStyleProvider } from '../StyleProvider';
import './LinkPopup.scss';
import React = require('react');
+import { OpenWhere } from '../nodes/DocumentView';
interface LinkPopupProps {
showPopup: boolean;
linkFrom?: () => Doc | undefined;
+ linkCreateAnchor?: () => Doc | undefined;
+ linkCreated?: (link: Doc) => void;
// groupType: string;
// linkDoc: Doc;
// docView: DocumentView;
@@ -32,14 +35,10 @@ export class LinkPopup extends React.Component<LinkPopupProps> {
// TODO: should check for valid URL
@undoBatch
- makeLinkToURL = (target: string, lcoation: string) => {
- ((this.view as any)?.TextView as FormattedTextBox).makeLinkAnchor(undefined, 'onRadd:rightight', target, target);
- };
+ makeLinkToURL = (target: string, lcoation: string) => ((this.view as any)?.TextView as FormattedTextBox).makeLinkAnchor(undefined, OpenWhere.addRight, target, target);
@action
- onLinkChange = (e: React.ChangeEvent<HTMLInputElement>) => {
- this.linkURL = e.target.value;
- };
+ onLinkChange = (e: React.ChangeEvent<HTMLInputElement>) => (this.linkURL = e.target.value);
getPWidth = () => 500;
getPHeight = () => 500;
@@ -67,7 +66,9 @@ export class LinkPopup extends React.Component<LinkPopupProps> {
Document={Doc.MySearcher}
DataDoc={Doc.MySearcher}
linkFrom={linkDoc}
+ linkCreateAnchor={this.props.linkCreateAnchor}
linkSearch={true}
+ linkCreated={this.props.linkCreated}
fieldKey="data"
dropAction="move"
isSelected={returnTrue}