Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Bring back merge of pull request #11958
Browse files Browse the repository at this point in the history
Auditors: @bsclifton
fixes #11632
-
This reverts the revert. More information in
#11632

This reverts commit d2708a0.
  • Loading branch information
cezaraugusto committed Nov 15, 2017
1 parent e729d46 commit 2e71dfd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions app/renderer/components/tabs/tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ class Tab extends React.Component {

onMouseEnter (e) {
windowActions.setTabHoverState(this.props.frameKey, true)
// In case there's a tab preview happening, cancel the preview
// when mouse is over a tab
windowActions.setTabPageHoverState(this.props.tabPageIndex, false)
}

onAuxClick (e) {
Expand Down Expand Up @@ -245,6 +248,7 @@ class Tab extends React.Component {
props.isNarrowestView = tabContentState.isNarrowestView(currentWindow, props.frameKey)
props.isPlayIndicatorBreakpoint = tabContentState.isMediumView(currentWindow, props.frameKey) || props.isNarrowView
props.title = frame.get('title')
props.tabPageIndex = currentWindow.getIn(['ui', 'tabs', 'tabPageIndex'])
props.showSessionIcon = partition && hasSeconardImage
props.showPrivateIcon = props.isPrivateTab && hasSeconardImage
props.showFavIcon = !((hasBreakpoint(breakpoint, 'extraSmall') && props.isActive) || frame.get('location') === 'about:newtab')
Expand Down
8 changes: 6 additions & 2 deletions app/renderer/components/tabs/tabPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ class TabPage extends React.Component {
}

onCloseTabPage () {
// if a tab page is closed, cancel the tab preview
windowActions.setTabPageHoverState(this.props.index, false)

return this.props.tabPageFrames
.map(frame => appActions.tabCloseRequested(frame.get('tabId')))
}
Expand All @@ -92,12 +95,13 @@ class TabPage extends React.Component {
return
case 1:
// Close tab page with middle click
// and eventually cancel the hover state
this.onCloseTabPage()
windowActions.setTabPageHoverState(this.props.index, false)
break
default:
// Setting the new active tab page
// should also cancel tab preview
windowActions.setTabPageIndex(this.props.index)
windowActions.setTabPageHoverState(this.props.index, false)
}
}

Expand Down

0 comments on commit 2e71dfd

Please sign in to comment.