aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/PropertiesButtons.tsx
diff options
context:
space:
mode:
authorGeireann Lindfield Roberts <60007097+geireann@users.noreply.github.com>2020-08-06 05:11:18 +0800
committerGeireann Lindfield Roberts <60007097+geireann@users.noreply.github.com>2020-08-06 05:11:18 +0800
commitfa0b28c300416621dec25407484fc2606a736e2a (patch)
tree61baaa7197c80ed23da6c12b70a5202557598bfc /src/client/views/PropertiesButtons.tsx
parent917deb0c0d73997f4ffa465e75ac05fdca7a8519 (diff)
automatic text progressivize, ui changes, bug fixes
Diffstat (limited to 'src/client/views/PropertiesButtons.tsx')
-rw-r--r--src/client/views/PropertiesButtons.tsx37
1 files changed, 36 insertions, 1 deletions
diff --git a/src/client/views/PropertiesButtons.tsx b/src/client/views/PropertiesButtons.tsx
index d46c03470..7d8a75dda 100644
--- a/src/client/views/PropertiesButtons.tsx
+++ b/src/client/views/PropertiesButtons.tsx
@@ -30,6 +30,7 @@ import { undoBatch, UndoManager } from '../util/UndoManager';
import { DocumentType } from '../documents/DocumentTypes';
import { CollectionFreeFormView } from './collections/collectionFreeForm/CollectionFreeFormView';
import { InkField } from '../../fields/InkField';
+import { PresBox } from './nodes/PresBox';
const higflyout = require("@hig/flyout");
export const { anchorPoints } = higflyout;
export const Flyout = higflyout.default;
@@ -209,7 +210,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" : "", color: isPinned ? "black" : "white" }}
+ style={{ backgroundColor: isPinned ? "" : "white", color: isPinned ? "white" : "black" }}
onClick={e => DockedFrameRenderer.PinDoc(targetDoc, isPinned)}>
<FontAwesomeIcon className="documentdecorations-icon" size="sm" icon="map-pin"
/>
@@ -217,6 +218,37 @@ export class PropertiesButtons extends React.Component<{}, {}> {
}
@computed
+ get pinWithViewButton() {
+ const targetDoc = this.selectedDoc;
+ const isPinned = targetDoc && Doc.isDocPinned(targetDoc);
+ if (targetDoc) {
+ const x = targetDoc._panX;
+ const y = targetDoc._panY;
+ const scale = targetDoc._viewScale;
+ }
+ return !targetDoc ? (null) : <Tooltip title={<><div className="dash-tooltip">{"Pin with this view"}</div></>}>
+ <div className="propertiesButtons-linker"
+ style={{ backgroundColor: "white", color: "black" }}
+ onClick={e => {
+ if (targetDoc) {
+ DockedFrameRenderer.PinDoc(targetDoc, false);
+ const activeDoc = PresBox.Instance.childDocs[PresBox.Instance.childDocs.length - 1];
+ const x = targetDoc._panX;
+ const y = targetDoc._panY;
+ const scale = targetDoc._viewScale;
+ activeDoc.presPinView = true;
+ activeDoc.presPinViewX = x;
+ activeDoc.presPinViewY = y;
+ activeDoc.presPinViewScale = scale;
+ }
+ }}>
+ <div style={{ position: 'absolute', fontSize: 25, fontWeight: 700, transform: 'translate(42%, -7px)', color: 'rgba(0,0,0,0.2)' }}>V</div>
+ <FontAwesomeIcon className="documentdecorations-icon" size="sm" icon="map-pin" />
+ </div></Tooltip>;
+ }
+
+
+ @computed
get metadataButton() {
//const view0 = this.view0;
if (this.selectedDoc) {
@@ -608,6 +640,9 @@ export class PropertiesButtons extends React.Component<{}, {}> {
{this.pinButton}
</div>
<div className="propertiesButtons-button">
+ {this.pinWithViewButton}
+ </div>
+ <div className="propertiesButtons-button">
{this.copyButton}
</div>
<div className="propertiesButtons-button">