From d3c5e42de48f59695952af85e1af84251d7d6988 Mon Sep 17 00:00:00 2001 From: Hannah Chow Date: Mon, 11 Mar 2019 19:41:20 -0400 Subject: got buttons to be responsive to number of links --- src/client/views/DocumentDecorations.scss | 13 +++++++++++-- src/client/views/DocumentDecorations.tsx | 5 ++++- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/client/views/DocumentDecorations.scss b/src/client/views/DocumentDecorations.scss index 5912d5901..e77e22c5d 100644 --- a/src/client/views/DocumentDecorations.scss +++ b/src/client/views/DocumentDecorations.scss @@ -80,8 +80,8 @@ } .linkButton-empty { - height: 16px; - width: 16px; + height: 20px; + width: 20px; margin-top: 10px; border-radius: 50%; opacity: 0.9; @@ -92,6 +92,11 @@ letter-spacing: 2px; font-size: 75%; transition: transform 0.2s; + text-align: center; + display: flex; + vertical-align: middle; + justify-content: center; + align-items: center; } .linkButton-nonempty { @@ -107,4 +112,8 @@ letter-spacing: 2px; font-size: 75%; transition: transform 0.2s; + text-align: center; + display: flex; + justify-content: center; + align-items: center; } \ No newline at end of file diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx index 313b35ca8..3bdb7d5b3 100644 --- a/src/client/views/DocumentDecorations.tsx +++ b/src/client/views/DocumentDecorations.tsx @@ -208,13 +208,16 @@ export class DocumentDecorations extends React.Component { let linkButton = null; if (SelectionManager.SelectedDocuments().length > 0) { let selFirst = SelectionManager.SelectedDocuments()[0]; + let linkToSize = selFirst.props.Document.GetData(KeyStore.LinkedToDocs, ListField, []).length; + let linkFromSize = selFirst.props.Document.GetData(KeyStore.LinkedFromDocs, ListField, []).length; + let linkCount = linkToSize + linkFromSize; linkButton = ( }> -
+
{linkCount}
); } return ( -- cgit v1.2.3-70-g09d2