aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/DocumentButtonBar.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-06-14 09:12:13 -0400
committerbobzel <zzzman@gmail.com>2023-06-14 09:12:13 -0400
commit376270791c7fe414c05a87f73afe11146d119c35 (patch)
treec6c788c958a5aaca4a9bbdd709d5e6f1d76dde0d /src/client/views/DocumentButtonBar.tsx
parent2bc89733ce522527c2f27203b537d99395c9479b (diff)
parentbf16eca7a84adfdf1c5970e7e4793568ee70325d (diff)
Merge branch 'master' into advanced-trails
Diffstat (limited to 'src/client/views/DocumentButtonBar.tsx')
-rw-r--r--src/client/views/DocumentButtonBar.tsx26
1 files changed, 11 insertions, 15 deletions
diff --git a/src/client/views/DocumentButtonBar.tsx b/src/client/views/DocumentButtonBar.tsx
index 8c2ced55a..35b0b22a8 100644
--- a/src/client/views/DocumentButtonBar.tsx
+++ b/src/client/views/DocumentButtonBar.tsx
@@ -178,7 +178,7 @@ export class DocumentButtonBar extends React.Component<{ views: () => (DocumentV
e.preventDefault();
let googleDoc = await Cast(dataDoc.googleDoc, Doc);
if (!googleDoc) {
- const options = { _width: 600, _nativeWidth: 960, _nativeHeight: 800, useCors: false };
+ const options = { _width: 600, _nativeWidth: 960, _nativeHeight: 800, data_useCors: false };
googleDoc = Docs.Create.WebDocument(googleDocUrl, options);
dataDoc.googleDoc = googleDoc;
}
@@ -303,10 +303,6 @@ export class DocumentButtonBar extends React.Component<{ views: () => (DocumentV
onPointerEnter={action(e => (this.subEndLink = (pinLayout ? 'Layout' : '') + (pinLayout && pinContent ? ' &' : '') + (pinContent ? ' Content' : '')))}
onPointerLeave={action(e => (this.subEndLink = ''))}
onClick={e => {
- const docs = this.props
- .views()
- .filter(v => v)
- .map(dv => dv!.rootDoc);
this.view0 &&
DocumentLinksButton.finishLinkClick(e.clientX, e.clientY, DocumentLinksButton.StartLink, this.view0.props.Document, true, this.view0, {
pinDocLayout: pinLayout,
@@ -477,17 +473,17 @@ export class DocumentButtonBar extends React.Component<{ views: () => (DocumentV
</Tooltip>
);
}
- @observable _aliasDown = false;
+ @observable _embedDown = false;
onTemplateButton = action((e: React.PointerEvent): void => {
this._tooltipOpen = false;
- setupMoveUpEvents(this, e, this.onAliasButtonMoved, emptyFunction, emptyFunction);
+ setupMoveUpEvents(this, e, this.onEmbedButtonMoved, emptyFunction, emptyFunction);
});
- onAliasButtonMoved = () => {
+ onEmbedButtonMoved = () => {
if (this._dragRef.current) {
const dragDocView = this.view0!;
const dragData = new DragManager.DocumentDragData([dragDocView.props.Document]);
const [left, top] = dragDocView.props.ScreenToLocalTransform().inverse().transformPoint(0, 0);
- dragData.defaultDropAction = 'alias';
+ dragData.defaultDropAction = 'embed';
dragData.canEmbed = true;
DragManager.StartDocumentDrag([dragDocView.ContentDiv!], dragData, left, top, { hideSource: false });
return true;
@@ -502,14 +498,14 @@ export class DocumentButtonBar extends React.Component<{ views: () => (DocumentV
const view0 = this.view0;
const views = this.props.views();
return !view0 ? null : (
- <Tooltip title={<div className="dash-tooltip">Tap to Customize Layout. Drag an embeddable alias</div>} open={this._tooltipOpen} onClose={action(() => (this._tooltipOpen = false))} placement="bottom">
+ <Tooltip title={<div className="dash-tooltip">Tap to Customize Layout. Drag an embedding</div>} open={this._tooltipOpen} onClose={action(() => (this._tooltipOpen = false))} placement="bottom">
<div className="documentButtonBar-linkFlyout" ref={this._dragRef} onPointerEnter={action(() => !this._ref.current?.getBoundingClientRect().width && (this._tooltipOpen = true))}>
<Flyout
anchorPoint={anchorPoints.LEFT_TOP}
- onOpen={action(() => (this._aliasDown = true))}
- onClose={action(() => (this._aliasDown = false))}
+ onOpen={action(() => (this._embedDown = true))}
+ onClose={action(() => (this._embedDown = false))}
content={
- !this._aliasDown ? null : (
+ !this._embedDown ? null : (
<div ref={this._ref}>
{' '}
<TemplateMenu docViews={views.filter(v => v).map(v => v as DocumentView)} />
@@ -568,7 +564,7 @@ export class DocumentButtonBar extends React.Component<{ views: () => (DocumentV
const anchor = rootView.ComponentView?.getAnchor?.(false) ?? rootDoc;
const trail = DocCast(anchor.presTrail) ?? Doc.MakeCopy(DocCast(Doc.UserDoc().emptyTrail), true);
if (trail !== anchor.presTrail) {
- DocUtils.MakeLink(anchor, trail, { linkRelationship: 'link trail' });
+ DocUtils.MakeLink(anchor, trail, { link_relationship: 'link trail' });
anchor.presTrail = trail;
}
Doc.ActivePresentation = trail;
@@ -593,7 +589,7 @@ export class DocumentButtonBar extends React.Component<{ views: () => (DocumentV
<LinkPopup
key="popup"
showPopup={this._showLinkPopup}
- linkCreated={link => (link.linkDisplay = !IsFollowLinkScript(this.props.views().lastElement()?.rootDoc.onClick))}
+ linkCreated={link => (link.link_displayLine = !IsFollowLinkScript(this.props.views().lastElement()?.rootDoc.onClick))}
linkCreateAnchor={() => this.props.views().lastElement()?.ComponentView?.getAnchor?.(true)}
linkFrom={() => this.props.views().lastElement()?.rootDoc}
/>