mirror of
https://github.com/zadam/trilium.git
synced 2025-11-05 04:45:47 +01:00
split window WIP
This commit is contained in:
@@ -16,15 +16,33 @@ export default class PaneContainer extends FlexContainer {
|
||||
this.css('flex-grow', '1');
|
||||
}
|
||||
|
||||
doRender() {
|
||||
super.doRender();
|
||||
|
||||
this.$widget.find("div").on("click", () => {
|
||||
const activeTabContext = appContext.tabManager.getActiveTabContext();
|
||||
|
||||
const tabId = activeTabContext.parentTabId || activeTabContext.tabId;
|
||||
|
||||
appContext.tabManager.activateTab(tabId);
|
||||
});
|
||||
}
|
||||
|
||||
async openNewPaneCommand() {
|
||||
const newWidget = this.widgetFactory();
|
||||
|
||||
this.$widget.append(newWidget.render());
|
||||
const $rendered = newWidget.render();
|
||||
|
||||
this.$widget.append($rendered);
|
||||
|
||||
const tabContext = new TabContext();
|
||||
appContext.tabManager.tabContexts.push(tabContext);
|
||||
appContext.tabManager.child(tabContext);
|
||||
|
||||
$rendered.on('click', () => {
|
||||
appContext.tabManager.activateTab(tabContext.tabId);
|
||||
});
|
||||
|
||||
tabContext.parentTabId = appContext.tabManager.getActiveTabContext().tabId;
|
||||
|
||||
await newWidget.handleEvent('setTabContext', { tabContext });
|
||||
|
||||
Reference in New Issue
Block a user