aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/DocumentDecorations.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/DocumentDecorations.tsx')
-rw-r--r--src/client/views/DocumentDecorations.tsx15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx
index 255855b45..40f2c3da9 100644
--- a/src/client/views/DocumentDecorations.tsx
+++ b/src/client/views/DocumentDecorations.tsx
@@ -54,6 +54,7 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>
private _downY = 0;
private _iconDoc?: Doc = undefined;
private _resizeUndo?: UndoManager.Batch;
+ private _linkDrag?: UndoManager.Batch;
@observable private _minimizedX = 0;
@observable private _minimizedY = 0;
@observable private _title: string = "";
@@ -96,6 +97,7 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>
}
else {
if (SelectionManager.SelectedDocuments().length > 0) {
+ SelectionManager.SelectedDocuments()[0].props.Document.customTitle = true;
let field = SelectionManager.SelectedDocuments()[0].props.Document[this._fieldKey];
if (typeof field === "number") {
SelectionManager.SelectedDocuments().forEach(d => {
@@ -413,9 +415,15 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>
let container = selDoc.props.ContainingCollectionView ? selDoc.props.ContainingCollectionView.props.Document.proto : undefined;
let dragData = new DragManager.LinkDragData(selDoc.props.Document, container ? [container] : []);
FormattedTextBox.InputBoxOverlay = undefined;
+ this._linkDrag = UndoManager.StartBatch("Drag Link");
DragManager.StartLinkDrag(this._linkerButton.current, dragData, e.pageX, e.pageY, {
handlers: {
- dragComplete: action(emptyFunction),
+ dragComplete: () => {
+ if (this._linkDrag) {
+ this._linkDrag.end();
+ this._linkDrag = undefined;
+ }
+ },
},
hideSource: false
});
@@ -533,7 +541,7 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>
proto.nativeHeight = nheight = doc.height || 0;
proto.ignoreAspect = true;
}
- if (nwidth > 0 && nheight > 0) {
+ if (nwidth > 0 && nheight > 0 && !BoolCast(proto.ignoreAspect)) {
if (Math.abs(dW) > Math.abs(dH)) {
if (!fixedAspect) {
Doc.SetInPlace(element.props.Document, "nativeWidth", actualdW / (doc.width || 1) * (doc.nativeWidth || 0), true);
@@ -553,7 +561,7 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>
} else {
dW && (doc.width = actualdW);
dH && (doc.height = actualdH);
- Doc.SetInPlace(element.props.Document, "autoHeight", undefined, true);
+ dH && Doc.SetInPlace(element.props.Document, "autoHeight", undefined, true);
}
}
});
@@ -668,6 +676,7 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>
linkButton = (<Flyout
anchorPoint={anchorPoints.RIGHT_TOP}
content={<LinkMenu docView={selFirst}
+ addDocTab={selFirst.props.addDocTab}
changeFlyout={this.changeFlyoutContent} />}>
<div className={"linkButton-" + (linkCount ? "nonempty" : "empty")} onPointerDown={this.onLinkButtonDown} >{linkCount}</div>
</Flyout >);