mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
Expose focusActiveTerm function to window
This commit is contained in:
parent
9ba47135a8
commit
7074cbe29b
2 changed files with 5 additions and 2 deletions
|
|
@ -27,11 +27,12 @@ export default class Header extends React.PureComponent {
|
|||
this.props.onChangeTab(active);
|
||||
}
|
||||
|
||||
handleHeaderMouseDown(ev) {
|
||||
handleHeaderMouseDown() {
|
||||
// the hack of all hacks, this prevents the term
|
||||
// iframe from losing focus, for example, when
|
||||
// the user drags the nav around
|
||||
ev.preventDefault();
|
||||
// Fixed by calling window.focusActiveTerm(), thus we can support drag tab
|
||||
// ev.preventDefault();
|
||||
|
||||
// persist start positions of a potential drag motion
|
||||
// to differentiate dragging from clicking
|
||||
|
|
@ -111,6 +112,7 @@ export default class Header extends React.PureComponent {
|
|||
<header
|
||||
className={`header_header ${isMac && 'header_headerRounded'}`}
|
||||
onMouseDown={this.handleHeaderMouseDown}
|
||||
onMouseUp={() => window.focusActiveTerm()}
|
||||
onDoubleClick={this.handleMaximizeClick}
|
||||
>
|
||||
{!isMac && (
|
||||
|
|
|
|||
|
|
@ -87,6 +87,7 @@ class Hyper extends React.PureComponent {
|
|||
|
||||
onTermsRef(terms) {
|
||||
this.terms = terms;
|
||||
window.focusActiveTerm = this.handleFocusActive;
|
||||
}
|
||||
|
||||
componentDidUpdate(prev) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue