aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSam Wilkins <35748010+samwilkins333@users.noreply.github.com>2019-06-18 13:18:34 -0400
committerGitHub <noreply@github.com>2019-06-18 13:18:34 -0400
commit9544576ec0167d64f564ae4c87d392eba07ff467 (patch)
tree62fd593e970caac3e7812bec0a7d097def8db831 /src
parent2633f61d311528e62d50d4ff56f5884b3b51ac61 (diff)
Added tab focusing on hover
Diffstat (limited to 'src')
-rw-r--r--src/client/views/collections/CollectionDockingView.tsx11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx
index 4d48cedd8..9aa4ab45a 100644
--- a/src/client/views/collections/CollectionDockingView.tsx
+++ b/src/client/views/collections/CollectionDockingView.tsx
@@ -336,6 +336,15 @@ export class CollectionDockingView extends React.Component<SubCollectionViewProp
tab.element.append(counter);
let upDiv = document.createElement("span");
const stack = tab.contentItem.parent;
+ // shifts the focus to this tab when another tab is dragged over it
+ tab.element[0].onmouseenter = (e: any) => {
+ if (!this._isPointerDown) return;
+ var activeContentItem = tab.header.parent.getActiveContentItem();
+ if (tab.contentItem !== activeContentItem) {
+ tab.header.parent.setActiveContentItem(tab.contentItem);
+ }
+ tab.setActive(true);
+ }
ReactDOM.render(<ParentDocSelector Document={doc} addDocTab={(doc, location) => CollectionDockingView.Instance.AddTab(stack, doc)} />, upDiv);
tab.reactComponents = [upDiv];
tab.element.append(upDiv);
@@ -503,4 +512,4 @@ export class DockedFrameRenderer extends React.Component<DockedFrameProps> {
{({ measureRef }) => <div ref={measureRef}> {theContent} </div>}
</Measure>;
}
-} \ No newline at end of file
+}