-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Yang Zhen
committed
Apr 7, 2017
1 parent
202bd18
commit 24c708c
Showing
6 changed files
with
177 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* @flow weak */ | ||
import store, { dispatch as $d } from '../../store' | ||
import * as Tab from '../../components/Tab/actions' | ||
import * as PaneActions from '../../components/Pane/actions' | ||
|
||
export default { | ||
'tab:close': c => { | ||
$d(Tab.removeTab(c.context.id)) | ||
}, | ||
|
||
'tab:close_other': c => { | ||
$d(Tab.removeOtherTab(c.context.id)) | ||
}, | ||
|
||
'tab:close_all': c => { | ||
$d(Tab.removeAllTab(c.context.id)) | ||
}, | ||
|
||
'tab:split_v': c => { | ||
const panes = store.getState().PaneState.panes | ||
const pane = Object.values(panes).find((pane) => ( | ||
pane.content && pane.content.type === 'tabGroup' && pane.content.id === c.context.tabGroupId | ||
)) | ||
$d(PaneActions.splitTo(pane.id, 'bottom')) | ||
.then(newPaneId => { | ||
$d(Tab.moveTabToPane(c.context.id, newPaneId)) | ||
}) | ||
}, | ||
|
||
'tab:split_h': c => { | ||
const panes = store.getState().PaneState.panes | ||
const pane = Object.values(panes).find((pane) => ( | ||
pane.content && pane.content.type === 'tabGroup' && pane.content.id === c.context.tabGroupId | ||
)) | ||
$d(PaneActions.splitTo(pane.id, 'right')) | ||
.then(newPaneId => { | ||
$d(Tab.moveTabToPane(c.context.id, newPaneId)) | ||
}) | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters