From 14d6fa20b47ff49a199fc8c181de6857c37bd227 Mon Sep 17 00:00:00 2001 From: bobzel Date: Sun, 25 Oct 2020 18:27:06 -0400 Subject: fixed undoing tab name --- src/client/views/collections/TabDocView.tsx | 4 ++-- src/client/views/nodes/PresBox.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/client/views/collections/TabDocView.tsx b/src/client/views/collections/TabDocView.tsx index 5bdf19a31..64e9df974 100644 --- a/src/client/views/collections/TabDocView.tsx +++ b/src/client/views/collections/TabDocView.tsx @@ -62,10 +62,10 @@ export class TabDocView extends React.Component { const titleEle = tab.titleElement[0]; titleEle.size = StrCast(doc.title).length + 3; titleEle.value = doc.title; - titleEle.onchange = (e: any) => { + titleEle.onchange = undoBatch(action((e: any) => { titleEle.size = e.currentTarget.value.length + 3; Doc.GetProto(doc).title = e.currentTarget.value; - }; + })); // shifts the focus to this tab when another tab is dragged over it tab.element[0].onmouseenter = (e: MouseEvent) => { if (SnappingManager.GetIsDragging() && tab.contentItem !== tab.header.parent.getActiveContentItem()) { diff --git a/src/client/views/nodes/PresBox.tsx b/src/client/views/nodes/PresBox.tsx index 54830d731..b72561644 100644 --- a/src/client/views/nodes/PresBox.tsx +++ b/src/client/views/nodes/PresBox.tsx @@ -150,7 +150,7 @@ export class PresBox extends ViewBoxBaseComponent DocListCastAsync((Doc.UserDoc().myPresentations as Doc).data).then(pres => !pres?.includes(this.rootDoc) && Doc.AddDocToList(Doc.UserDoc().myPresentations as Doc, "data", this.rootDoc)); this._disposers.selection = reaction(() => SelectionManager.SelectedDocuments(), - views => views.some(view => view.props.Document === this.rootDoc) && this.updateCurrentPresentation()) + views => views.some(view => view.props.Document === this.rootDoc) && this.updateCurrentPresentation()); } @action -- cgit v1.2.3-70-g09d2