Skip to content

Hackape/dnd tab on pane #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 7, 2016
Merged

Hackape/dnd tab on pane #19

merged 3 commits into from
Nov 7, 2016

Conversation

hackape
Copy link
Contributor

@hackape hackape commented Nov 3, 2016

补全之前做了一半的拖拽分屏任务,现在 tab 能正确转移到对应的 tabGroup 中。
close coding/WebIDE#50

@@ -0,0 +1,18 @@
const promiseActionMixin = (actionCreator) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这是之前在 Modal/actions 里用就过的一个模式,就是给 action 补上 .then/.catch 方法,让它成为一个伪 promise,可以在任何需要的地方调用 action.meta.resolve/.reject 来出发 promise resolve/reject.

现在把它抽象出来放到 utils 里。

@@ -56,7 +56,9 @@ class AceEditor extends Component {
editor.setTheme(`ace/theme/${theme}`);
editor.$blockScrolling = Infinity;
// dispatch(EditorActions.registerEditor(this.state.name, editor, this.editorDOM));
if (tab.content) {
if (tab.editor) {
editor.setSession(tab.editor.getSession())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tab.editor 是一个 ace Editor 实例。tab 在转移 tabGroup 的时候会把 tab.editor 一起带着走,但我找不到简单的方法去替换这个 editor instance 对应的 DOM,所以退而求其次,把它的 editorSession 转移到新建的 editor instance 里,效果也一样。

@hackape hackape merged commit 2646736 into master Nov 7, 2016
@hackape hackape deleted the hackape/dnd-tab-on-pane branch March 7, 2017 03:13
KevenYoung pushed a commit that referenced this pull request Aug 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

drag tab to split pane
2 participants