forked from DTStack/molecule
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: can't prevent close tab with confirm (DTStack#828)
* fix: take default close tab into extensions * chore: add confirm example in testPane
- Loading branch information
1 parent
d1cdbe1
commit 9418d40
Showing
4 changed files
with
63 additions
and
5 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,39 @@ | ||
import molecule from 'mo'; | ||
import { IExtension } from 'mo/model/extension'; | ||
|
||
export const ExtendsEditor: IExtension = { | ||
id: 'ExtendsEditor', | ||
name: 'Extends Editor', | ||
dispose() {}, | ||
activate() { | ||
molecule.editor.onCloseTab((tabId, groupId) => { | ||
if (tabId !== undefined && groupId !== undefined) { | ||
molecule.editor.closeTab(tabId, groupId); | ||
} | ||
}); | ||
|
||
molecule.editor.onCloseAll((groupId) => { | ||
if (groupId !== undefined) { | ||
molecule.editor.closeAll(groupId); | ||
} | ||
}); | ||
|
||
molecule.editor.onCloseOther((tabItem, groupId) => { | ||
if (tabItem && groupId !== undefined) { | ||
molecule.editor.closeOther(tabItem, groupId); | ||
} | ||
}); | ||
|
||
molecule.editor.onCloseToLeft((tabItem, groupId) => { | ||
if (tabItem && groupId !== undefined) { | ||
molecule.editor.closeToLeft(tabItem, groupId); | ||
} | ||
}); | ||
|
||
molecule.editor.onCloseToRight((tabItem, groupId) => { | ||
if (tabItem && groupId !== undefined) { | ||
molecule.editor.closeToRight(tabItem, groupId); | ||
} | ||
}); | ||
}, | ||
}; |
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