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

Trigger tab preview based on frame key #8902

Merged
merged 1 commit into from
Jun 2, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions app/renderer/reducers/frameReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,18 @@ const closeFrame = (state, action) => {
if (state.get('frames', Immutable.List()).size === 0) {
appActions.closeWindow(getCurrentWindowId())
}
// 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.

const nextFrame = frameStateUtil.getFrameByIndex(state, index)
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