aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/collections')
-rw-r--r--src/client/views/collections/CollectionDockingView.tsx12
-rw-r--r--src/client/views/collections/collectionFreeForm/MarqueeOptionsMenu.tsx12
2 files changed, 12 insertions, 12 deletions
diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx
index 7e096fa37..0c93b4e63 100644
--- a/src/client/views/collections/CollectionDockingView.tsx
+++ b/src/client/views/collections/CollectionDockingView.tsx
@@ -513,7 +513,11 @@ export class CollectionDockingView extends React.Component<SubCollectionViewProp
const doc = await DocServer.GetRefField(tab.contentItem.config.props.documentId) as Doc;
if (doc instanceof Doc) {
- tab.titleElement[0].onclick = (e: any) => tab.titleElement[0].focus();
+ tab.titleElement[0].onclick = (e: any) => {
+ if (Date.now() - tab.titleElement[0].lastClick < 1000) tab.titleElement[0].select();
+ tab.titleElement[0].lastClick = Date.now();
+ tab.titleElement[0].focus();
+ }
tab.titleElement[0].onchange = (e: any) => {
tab.titleElement[0].size = e.currentTarget.value.length + 1;
Doc.GetProto(doc).title = e.currentTarget.value, true;
@@ -691,8 +695,8 @@ export class DockedFrameRenderer extends React.Component<DockedFrameProps> {
return (this.props as any).glContainer.parent.parent;
}
get _tab(): any {
- const tab = (this.props as any).glContainer.tab.element[0] as HTMLElement;
- return tab.getElementsByClassName("lm_title")?.[0];
+ const tab = (this.props as any).glContainer.tab?.element[0] as HTMLElement;
+ return tab?.getElementsByClassName("lm_title")?.[0];
}
constructor(props: any) {
super(props);
@@ -757,7 +761,7 @@ export class DockedFrameRenderer extends React.Component<DockedFrameProps> {
this._tabReaction = reaction(() => ({ views: SelectionManager.SelectedDocuments(), color: StrCast(this._document?._backgroundColor, "white") }),
(data) => {
const selected = data.views.some(v => Doc.AreProtosEqual(v.props.Document, this._document));
- this._tab.style.backgroundColor = selected ? data.color : "";
+ this._tab && (this._tab.style.backgroundColor = selected ? data.color : "");
}
);
}
diff --git a/src/client/views/collections/collectionFreeForm/MarqueeOptionsMenu.tsx b/src/client/views/collections/collectionFreeForm/MarqueeOptionsMenu.tsx
index d27ca7c3a..f1df7998b 100644
--- a/src/client/views/collections/collectionFreeForm/MarqueeOptionsMenu.tsx
+++ b/src/client/views/collections/collectionFreeForm/MarqueeOptionsMenu.tsx
@@ -25,34 +25,30 @@ export default class MarqueeOptionsMenu extends AntimodeMenu {
render() {
const buttons = [
- <Tooltip title={<><div className="dash-tooltip">Create a Collection</div></>} placement="bottom">
+ <Tooltip key="group" title={<><div className="dash-tooltip">Create a Collection</div></>} placement="bottom">
<button
className="antimodeMenu-button"
- key="group"
onPointerDown={this.createCollection}>
<FontAwesomeIcon icon="object-group" size="lg" />
</button>
</Tooltip>,
- <Tooltip title={<><div className="dash-tooltip">Summarize Documents</div></>} placement="bottom">
+ <Tooltip key="summarize" title={<><div className="dash-tooltip">Summarize Documents</div></>} placement="bottom">
<button
className="antimodeMenu-button"
- key="summarize"
onPointerDown={this.summarize}>
<FontAwesomeIcon icon="compress-arrows-alt" size="lg" />
</button>
</Tooltip>,
- <Tooltip title={<><div className="dash-tooltip">Delete Documents</div></>} placement="bottom">
+ <Tooltip key="delete" title={<><div className="dash-tooltip">Delete Documents</div></>} placement="bottom">
<button
className="antimodeMenu-button"
- key="delete"
onPointerDown={this.delete}>
<FontAwesomeIcon icon="trash-alt" size="lg" />
</button>
</Tooltip>,
- <Tooltip title={<><div className="dash-tooltip">Change to Text</div></>} placement="bottom">
+ <Tooltip key="inkToText" title={<><div className="dash-tooltip">Change to Text</div></>} placement="bottom">
<button
className="antimodeMenu-button"
- key="inkToText"
onPointerDown={this.inkToText}>
<FontAwesomeIcon icon="font" size="lg" />
</button>