aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/PropertiesButtons.tsx
diff options
context:
space:
mode:
authoranika-ahluwalia <anika.ahluwalia@gmail.com>2020-08-02 18:20:59 -0500
committeranika-ahluwalia <anika.ahluwalia@gmail.com>2020-08-02 18:20:59 -0500
commitac177d7b9a01075fbf1ad1c327c7625d95569afb (patch)
treeea89bf577df1afa960109f2b741dee3faec450c5 /src/client/views/PropertiesButtons.tsx
parentf818303cb164b471805075226cba5451f35b27a2 (diff)
bug fixes found with sally
Diffstat (limited to 'src/client/views/PropertiesButtons.tsx')
-rw-r--r--src/client/views/PropertiesButtons.tsx29
1 files changed, 20 insertions, 9 deletions
diff --git a/src/client/views/PropertiesButtons.tsx b/src/client/views/PropertiesButtons.tsx
index 59e7cc7c8..d3f056a34 100644
--- a/src/client/views/PropertiesButtons.tsx
+++ b/src/client/views/PropertiesButtons.tsx
@@ -208,7 +208,7 @@ export class PropertiesButtons extends React.Component<{}, {}> {
const isPinned = targetDoc && Doc.isDocPinned(targetDoc);
return !targetDoc ? (null) : <Tooltip title={<><div className="dash-tooltip">{Doc.isDocPinned(targetDoc) ? "Unpin from presentation" : "Pin to presentation"}</div></>}>
<div className="propertiesButtons-linker"
- style={{ backgroundColor: isPinned ? "white" : "rgb(37, 43, 51)", color: isPinned ? "black" : "white" }}
+ style={{ backgroundColor: isPinned ? "white" : "", color: isPinned ? "black" : "white" }}
onClick={e => DockedFrameRenderer.PinDoc(targetDoc, isPinned)}>
<FontAwesomeIcon className="documentdecorations-icon" size="sm" icon="map-pin"
/>
@@ -238,6 +238,7 @@ export class PropertiesButtons extends React.Component<{}, {}> {
onAliasButtonDown = (e: React.PointerEvent): void => {
setupMoveUpEvents(this, e, this.onAliasButtonMoved, emptyFunction, emptyFunction);
}
+ @undoBatch
onAliasButtonMoved = () => {
if (this._dragRef.current) {
const dragDocView = this.selectedDocumentView!;
@@ -273,12 +274,17 @@ export class PropertiesButtons extends React.Component<{}, {}> {
</div></Tooltip>;
}
+ @undoBatch
onCopy = () => {
if (this.selectedDoc && this.selectedDocumentView) {
- const copy = Doc.MakeCopy(this.selectedDocumentView.props.Document, true);
- copy.x = NumCast(this.selectedDoc.x) + NumCast(this.selectedDoc._width);
- copy.y = NumCast(this.selectedDoc.y) + 30;
- this.selectedDocumentView.props.addDocument?.(copy);
+ // const copy = Doc.MakeCopy(this.selectedDocumentView.props.Document, true);
+ // copy.x = NumCast(this.selectedDoc.x) + NumCast(this.selectedDoc._width);
+ // copy.y = NumCast(this.selectedDoc.y) + 30;
+ // this.selectedDocumentView.props.addDocument?.(copy);
+ const alias = Doc.MakeAlias(this.selectedDoc);
+ alias.x = NumCast(this.selectedDoc.x) + NumCast(this.selectedDoc._width);
+ alias.y = NumCast(this.selectedDoc.y) + 30;
+ this.selectedDocumentView.props.addDocument?.(alias);
}
}
@@ -295,7 +301,7 @@ export class PropertiesButtons extends React.Component<{}, {}> {
</Tooltip>;
}
- @action
+ @action @undoBatch
onLock = () => {
this.selectedDocumentView?.toggleLockPosition();
}
@@ -337,15 +343,19 @@ export class PropertiesButtons extends React.Component<{}, {}> {
return !targetDoc ? (null) : <Tooltip
title={<><div className="dash-tooltip">{"Delete Document"}</div></>}>
<div className={"propertiesButtons-linkButton-empty"}
- onPointerDown={() => {
- this.selectedDocumentView?.props.ContainingCollectionView?.removeDocument(this.selectedDocumentView?.props.Document);
- }}>
+ onPointerDown={this.deleteDocument}>
{<FontAwesomeIcon className="propertiesButtons-icon"
icon="trash-alt" size="sm" />}
</div>
</Tooltip>;
}
+ @undoBatch
+ @action
+ deleteDocument = () => {
+ this.selectedDocumentView?.props.ContainingCollectionView?.removeDocument(this.selectedDocumentView?.props.Document);
+ }
+
@computed
get sharingButton() {
const targetDoc = this.selectedDoc;
@@ -380,6 +390,7 @@ export class PropertiesButtons extends React.Component<{}, {}> {
}
}
+ @undoBatch
@action
handleOptionChange = (e: any) => {
const value = e.target.value;