aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/util/DocumentManager.ts2
-rw-r--r--src/client/views/collections/TabDocView.scss12
-rw-r--r--src/client/views/collections/TabDocView.tsx10
3 files changed, 16 insertions, 8 deletions
diff --git a/src/client/util/DocumentManager.ts b/src/client/util/DocumentManager.ts
index 903760c58..c3d78a028 100644
--- a/src/client/util/DocumentManager.ts
+++ b/src/client/util/DocumentManager.ts
@@ -162,8 +162,6 @@ export class DocumentManager {
docView.props.Document.hidden = !docView.props.Document.hidden;
}
else {
- const contView = docContext && getFirstDocView(docContext, originatingDoc);
- contView && contView.topMost && contView.select(false); // bcz: change this to a function prop: popTab() that will make sure the tab for the document is topmost;
docView.select(false);
docView.props.Document.hidden && (docView.props.Document.hidden = undefined);
docView.props.focus(docView.props.Document, willZoom, undefined, focusAndFinish);
diff --git a/src/client/views/collections/TabDocView.scss b/src/client/views/collections/TabDocView.scss
index c0a46543d..5dfb9366a 100644
--- a/src/client/views/collections/TabDocView.scss
+++ b/src/client/views/collections/TabDocView.scss
@@ -1,5 +1,13 @@
-input.lm_title:focus {
- max-width: max-content !important;
+input.lm_title:focus,
+input.lm_title
+{
+ max-width: unset !important;
+ transition-delay: unset;
+ width: 100%;
+}
+input.lm_title {
+ transition-delay: 0.35s;
+ width: 100px;
}
.miniMap-hidden,
.miniMap {
diff --git a/src/client/views/collections/TabDocView.tsx b/src/client/views/collections/TabDocView.tsx
index 62f6d50fc..76ca82c63 100644
--- a/src/client/views/collections/TabDocView.tsx
+++ b/src/client/views/collections/TabDocView.tsx
@@ -61,7 +61,6 @@ export class TabDocView extends React.Component<TabDocViewProps> {
const titleEle = tab.titleElement[0];
titleEle.size = StrCast(doc.title).length + 3;
titleEle.value = doc.title;
- titleEle.style["max-width"] = "100px";
titleEle.onchange = (e: any) => {
titleEle.size = e.currentTarget.value.length + 3;
Doc.GetProto(doc).title = e.currentTarget.value;
@@ -81,7 +80,7 @@ export class TabDocView extends React.Component<TabDocViewProps> {
};
// select the tab document when the tab is directly clicked and activate the tab whenver the tab document is selected
- tab.element[0].onclick = (e: any) => {
+ titleEle.onpointerdown = (e: any) => {
if (e.target.className !== "lm_close_tab" && this.view) {
SelectionManager.SelectDoc(this.view, false);
if (Date.now() - titleEle.lastClick < 1000) titleEle.select();
@@ -197,7 +196,7 @@ export class TabDocView extends React.Component<TabDocViewProps> {
this._isActive = this.props.glContainer.tab.isActive;
(CollectionDockingView.Instance as any)._goldenLayout?.isInitialised && CollectionDockingView.Instance.stateChanged();
!this._isActive && this._document && Doc.UnBrushDoc(this._document); // bcz: bad -- trying to simulate a pointer leave event when a new tab is opened up on top of an existing one.
- this._isActive && this.view && SelectionManager.SelectDoc(this.view, false);
+ // this._isActive && this.view && SelectionManager.SelectDoc(this.view, false);
}
}
@@ -339,7 +338,10 @@ export class TabDocView extends React.Component<TabDocViewProps> {
</Tooltip>
</>;
}
- focusFunc = (doc: Doc, willZoom: boolean, scale?: number, afterFocus?: () => void) => afterFocus?.();
+ focusFunc = (doc: Doc, willZoom: boolean, scale?: number, afterFocus?: () => void) => {
+ this.tab.header.parent.setActiveContentItem(this.tab.contentItem)
+ afterFocus?.();
+ }
setView = action((view: DocumentView) => this._view = view);
active = () => this._isActive;
@computed get docView() {