aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/DocumentButtonBar.tsx
diff options
context:
space:
mode:
authorMichael Foiani <sotech117@Michaels-MacBook-Pro-5.local>2022-06-23 13:13:46 -0400
committerMichael Foiani <sotech117@Michaels-MacBook-Pro-5.local>2022-06-23 13:13:46 -0400
commit7cacf9781395bc12c479acb51fa63cd0925a9430 (patch)
treed34cb900e73909006e1ca822f22c94a12634e01b /src/client/views/DocumentButtonBar.tsx
parent0370192be9c6c723f198fbf28d2a63ceef0e70d4 (diff)
parent8eb794e233f905daaa5b9a25c6720e567512653e (diff)
merge with mehek video
Diffstat (limited to 'src/client/views/DocumentButtonBar.tsx')
-rw-r--r--src/client/views/DocumentButtonBar.tsx50
1 files changed, 3 insertions, 47 deletions
diff --git a/src/client/views/DocumentButtonBar.tsx b/src/client/views/DocumentButtonBar.tsx
index 103734b9b..9b8f7238d 100644
--- a/src/client/views/DocumentButtonBar.tsx
+++ b/src/client/views/DocumentButtonBar.tsx
@@ -204,54 +204,13 @@ export class DocumentButtonBar extends React.Component<{ views: () => (DocumentV
<div className="dash-tooltip">{SelectionManager.Views().length > 1 ? "Pin multiple documents to presentation" : "Pin to presentation"}</div>}>
<div className="documentButtonBar-icon"
style={{ color: "white" }}
- onClick={undoBatch(e => this.props.views().map(view => view && this.pinWithView(view.props.Document)))}>
+ onClick={(e => TabDocView.PinDoc(this.props.views().filter(v => v).map(dv => dv!.rootDoc), {pinDocView: true}))}
+ >
<FontAwesomeIcon className="documentdecorations-icon" size="sm" icon="map-pin" />
</div>
</Tooltip>;
}
- @undoBatch
- @action
- pinWithView = (targetDoc: Doc) => {
- const activeDoc = targetDoc && TabDocView.PinDoc(targetDoc);
- if (activeDoc) {
- const scrollable = [DocumentType.PDF, DocumentType.RTF, DocumentType.WEB].includes(targetDoc.type as any) || targetDoc._viewType === CollectionViewType.Stacking;
- const pannable: boolean = ((targetDoc.type === DocumentType.COL && targetDoc._viewType === CollectionViewType.Freeform) || targetDoc.type === DocumentType.IMG);
- if (scrollable) {
- const scroll = targetDoc._scrollTop;
- activeDoc.presPinView = true;
- activeDoc.presPinViewScroll = scroll;
- } else if ([DocumentType.AUDIO, DocumentType.VID].includes(targetDoc.type as any)) {
- activeDoc.presPinView = true;
- activeDoc.presStartTime = targetDoc._currentTimecode;
- activeDoc.presEndTime = NumCast(targetDoc._currentTimecode) + 0.1;
- } else if (pannable) {
- const x = targetDoc._panX;
- const y = targetDoc._panY;
- const scale = targetDoc._viewScale;
- activeDoc.presPinView = true;
- activeDoc.presPinViewX = x;
- activeDoc.presPinViewY = y;
- activeDoc.presPinViewScale = scale;
- } else if (targetDoc.type === DocumentType.COMPARISON) {
- const width = targetDoc._clipWidth;
- activeDoc.presPinClipWidth = width;
- activeDoc.presPinView = true;
- }
- }
- }
-
- @computed
- get pinWithViewButton() {
- const presPinWithViewIcon = <img src="/assets/pinWithView.png" style={{ margin: "auto", width: 17, transform: 'translate(0, 1px)' }} />;
- const targetDoc = this.view0?.props.Document;
- return !targetDoc ? (null) : <Tooltip title={<><div className="dash-tooltip">{"Pin with current view"}</div></>}>
- <div className="documentButtonBar-icon" onClick={() => this.pinWithView(targetDoc)}>
- {presPinWithViewIcon}
- </div>
- </Tooltip>;
- }
-
@computed
get shareButton() {
const targetDoc = this.view0?.props.Document;
@@ -376,9 +335,6 @@ export class DocumentButtonBar extends React.Component<{ views: () => (DocumentV
<div className="documentButtonBar-button">
{this.pinButton}
</div>
- {/* <div className="documentButtonBar-button">
- {this.pinWithViewButton}
- </div> */}
{!Doc.UserDoc()["documentLinksButton-fullMenu"] ? (null) : <div className="documentButtonBar-button">
{this.shareButton}
</div>}
@@ -391,7 +347,7 @@ export class DocumentButtonBar extends React.Component<{ views: () => (DocumentV
<div className="documentButtonBar-button">
{this.menuButton}
</div>
- {/* {Doc.UserDoc().noviceMode ? (null) : <div className="documentButtonBar-button">
+ {/* {Doc.noviceMode ? (null) : <div className="documentButtonBar-button">
{this.moreButton}
</div>} */}
</div>;