diff options
author | bobzel <zzzman@gmail.com> | 2020-10-25 18:27:06 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2020-10-25 18:27:06 -0400 |
commit | 14d6fa20b47ff49a199fc8c181de6857c37bd227 (patch) | |
tree | 89ed3208b47653a9df42fa3e97d9b8c4076fda99 | |
parent | e2b5bc51c1fa4b4ed026e6582b80086808bdcb70 (diff) |
fixed undoing tab name
-rw-r--r-- | src/client/views/collections/TabDocView.tsx | 4 | ||||
-rw-r--r-- | src/client/views/nodes/PresBox.tsx | 2 |
2 files changed, 3 insertions, 3 deletions
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<TabDocViewProps> { 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<FieldViewProps, PresBoxSchema> 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 |