mirror of
https://github.com/zadam/trilium.git
synced 2025-11-16 10:15:52 +01:00
Merge pull request #4001 from dymani/reopen-in-place
Reopen recently closed tab/split in place
This commit is contained in:
@@ -44,4 +44,8 @@ export default class MovePaneButton extends OnClickButtonWidget {
|
||||
async noteContextReorderEvent() {
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
async contextsReopenedEvent() {
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,6 +136,15 @@ export default class SplitNoteContainer extends FlexContainer {
|
||||
}
|
||||
}
|
||||
|
||||
contextsReopenedEvent({ntxId, afterNtxId}) {
|
||||
if (ntxId === undefined || afterNtxId === undefined) {
|
||||
// no single split reopened
|
||||
return;
|
||||
}
|
||||
this.$widget.find(`[data-ntx-id="${ntxId}"]`)
|
||||
.insertAfter(this.$widget.find(`[data-ntx-id="${afterNtxId}"]`));
|
||||
}
|
||||
|
||||
async refresh() {
|
||||
this.toggleExt(true);
|
||||
}
|
||||
|
||||
@@ -620,6 +620,15 @@ export default class TabRowWidget extends BasicWidget {
|
||||
this.updateTabById(newMainNtxId);
|
||||
}
|
||||
|
||||
contextsReopenedEvent({mainNtxId, tabPosition}) {
|
||||
if (mainNtxId === undefined || tabPosition === undefined) {
|
||||
// no tab reopened
|
||||
return;
|
||||
}
|
||||
const tabEl = this.getTabById(mainNtxId)[0];
|
||||
tabEl.parentNode.insertBefore(tabEl, this.tabEls[tabPosition]);
|
||||
}
|
||||
|
||||
updateTabById(ntxId) {
|
||||
const $tab = this.getTabById(ntxId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user