diff options
author | bobzel <zzzman@gmail.com> | 2022-12-16 15:07:50 -0500 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2022-12-16 15:07:50 -0500 |
commit | 403d1c4fece9efa663e0fd7161afff9f27cf670c (patch) | |
tree | 8287d487c4373655e6012d978a4af81058e6dc8d /src/client/views/linking/LinkPopup.tsx | |
parent | 61683e5e084f0b3a6c53bde08295a25b53ea2db3 (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/LinkPopup.tsx')
-rw-r--r-- | src/client/views/linking/LinkPopup.tsx | 13 |
1 files changed, 7 insertions, 6 deletions
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} |