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

Commit

Permalink
Trigger tab preview based on frame key
Browse files Browse the repository at this point in the history
- Auditors: @bsclifton, @luixxiul
- Close: #7606
  • Loading branch information
cezaraugusto committed May 23, 2017
1 parent 87e7340 commit c578679
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions app/renderer/reducers/frameReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,15 @@ const closeFrame = (state, action) => {

const nextFrame = frameStateUtil.getFrameByIndex(state, index)

// Copy the hover state if tab closed with mouse as long as we have a next frame
// This allow us to have closeTab button visible for sequential frames closing, until onMouseLeave event happens.
if (hoverState && nextFrame) {
windowActions.setTabHoverState(nextFrame.get('key'), hoverState)
if (nextFrame) {
// After closing a tab, preview the next frame
// as long as there is one
windowActions.setPreviewFrame(nextFrame.get('key'))
// Copy the hover state if tab closed with mouse as long as we have a next frame
// This allow us to have closeTab button visible for sequential frames closing, until onMouseLeave event happens.
if (hoverState) {
windowActions.setTabHoverState(nextFrame.get('key'), hoverState)
}
}

return state
Expand Down

0 comments on commit c578679

Please sign in to comment.