Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #92 from Coding/yangzhen/fix-style
Fix a few style issues, add context menu to tab
- Loading branch information
Showing
10 changed files
with
195 additions
and
12 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
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