aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/DocumentButtonBar.tsx
diff options
context:
space:
mode:
authorGeireann Lindfield Roberts <60007097+geireann@users.noreply.github.com>2020-08-17 19:51:57 +0800
committerGeireann Lindfield Roberts <60007097+geireann@users.noreply.github.com>2020-08-17 19:51:57 +0800
commit1baff66d1fe34a36db4aa5c817f049f4c1b04a1c (patch)
tree6568fc94fda99f829c91bb6e3d1e279e3ecad824 /src/client/views/DocumentButtonBar.tsx
parent7044fda26b17c0dac007952fb146bc8307339dce (diff)
bug fixes + new ways of adding pres with view
Diffstat (limited to 'src/client/views/DocumentButtonBar.tsx')
-rw-r--r--src/client/views/DocumentButtonBar.tsx9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/client/views/DocumentButtonBar.tsx b/src/client/views/DocumentButtonBar.tsx
index 8748b1880..edad9ce21 100644
--- a/src/client/views/DocumentButtonBar.tsx
+++ b/src/client/views/DocumentButtonBar.tsx
@@ -23,6 +23,7 @@ import { Template, Templates } from "./Templates";
import React = require("react");
import { DocumentLinksButton } from './nodes/DocumentLinksButton';
import { Tooltip } from '@material-ui/core';
+import { SelectionManager } from '../util/SelectionManager';
const higflyout = require("@hig/flyout");
export const { anchorPoints } = higflyout;
export const Flyout = higflyout.default;
@@ -195,7 +196,13 @@ export class DocumentButtonBar extends React.Component<{ views: () => (DocumentV
@computed
get pinButton() {
const targetDoc = this.view0?.props.Document;
- const isPinned = targetDoc && Doc.isDocPinned(targetDoc);
+ let isPinned = targetDoc && Doc.isDocPinned(targetDoc);
+ if (SelectionManager.SelectedDocuments().length > 1) {
+ SelectionManager.SelectedDocuments().forEach((docView: DocumentView) => {
+ if (Doc.isDocPinned(docView.props.Document)) isPinned = true;
+ else isPinned = false;
+ });
+ }
return !targetDoc ? (null) : <Tooltip title={<><div className="dash-tooltip">{Doc.isDocPinned(targetDoc) ? "Unpin from presentation" : "Pin to presentation"}</div></>}>
<div className="documentButtonBar-linker"
style={{ backgroundColor: isPinned ? "white" : "", color: isPinned ? "black" : "white", border: isPinned ? "black 1px solid " : "" }}