aboutsummaryrefslogtreecommitdiff
path: root/src/client/views
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2021-10-04 15:55:37 -0400
committerbobzel <zzzman@gmail.com>2021-10-04 15:55:37 -0400
commit76b833efe198a672795f61ee7a4b8d8cd6d5dd49 (patch)
treefce4439f34de6a80b9979c88215a3da10bad2d8c /src/client/views
parentc654a67db0da26abbf0ab920e8925d872443d22a (diff)
fixed dropping onto comparison box. added caption of link description to link comparison view. added promise wait for protos of link anchors to avoid potential crash. made dragging a link off of a linkmenuitem to create an alias with the hidden flag removed.
Diffstat (limited to 'src/client/views')
-rw-r--r--src/client/views/linking/LinkMenuItem.tsx4
-rw-r--r--src/client/views/nodes/ComparisonBox.tsx4
2 files changed, 5 insertions, 3 deletions
diff --git a/src/client/views/linking/LinkMenuItem.tsx b/src/client/views/linking/LinkMenuItem.tsx
index 53a7ae9ab..728956378 100644
--- a/src/client/views/linking/LinkMenuItem.tsx
+++ b/src/client/views/linking/LinkMenuItem.tsx
@@ -79,7 +79,9 @@ export class LinkMenuItem extends React.Component<LinkMenuItemProps> {
onEdit = (e: React.PointerEvent): void => {
LinkManager.currentLink = this.props.linkDoc;
setupMoveUpEvents(this, e, e => {
- DragManager.StartDocumentDrag([this._editRef.current!], new DragManager.DocumentDragData([this.props.linkDoc]), e.x, e.y);
+ const dragData = new DragManager.DocumentDragData([this.props.linkDoc], "alias");
+ dragData.removeDropProperties = ["hidden"];
+ DragManager.StartDocumentDrag([this._editRef.current!], dragData, e.x, e.y);
return true;
}, emptyFunction, () => this.props.showEditor(this.props.linkDoc));
}
diff --git a/src/client/views/nodes/ComparisonBox.tsx b/src/client/views/nodes/ComparisonBox.tsx
index 15c33c8bf..f23c68409 100644
--- a/src/client/views/nodes/ComparisonBox.tsx
+++ b/src/client/views/nodes/ComparisonBox.tsx
@@ -50,7 +50,7 @@ export class ComparisonBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatabl
}
private registerSliding = (e: React.PointerEvent<HTMLDivElement>, targetWidth: number) => {
- setupMoveUpEvents(this, e, this.onPointerMove, emptyFunction, action(() => {
+ e.button !== 2 && setupMoveUpEvents(this, e, this.onPointerMove, emptyFunction, action(() => {
// on click, animate slider movement to the targetWidth
this._animating = "all 200ms";
this.layoutDoc._clipWidth = targetWidth * 100 / this.props.PanelWidth();
@@ -107,7 +107,7 @@ export class ComparisonBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatabl
const displayBox = (which: string, index: number, cover: number) => {
return <div className={`${which}Box-cont`} key={which} style={{ width: this.props.PanelWidth() }}
onPointerDown={e => this.registerSliding(e, cover)}
- ref={ele => this.createDropTarget(ele, `compareBox-${which}`, index)} >
+ ref={ele => this.createDropTarget(ele, which, index)} >
{displayDoc(which)}
</div>;
};