sidebar & widget state management WIP

This commit is contained in:
zadam
2019-08-15 10:04:03 +02:00
parent 61520bc3b3
commit 59da25ef55
9 changed files with 286 additions and 97 deletions

View File

@@ -513,19 +513,18 @@ function openTabsChanged() {
}
async function saveOpenTabs() {
const activeTabEl = tabRow.activeTabEl;
const openTabs = [];
for (const tabEl of tabRow.tabEls) {
const tabId = tabEl.getAttribute('data-tab-id');
const tabContext = tabContexts.find(tc => tc.tabId === tabId);
if (tabContext && tabContext.notePath) {
openTabs.push({
tabId: tabContext.tabId,
notePath: tabContext.notePath,
active: activeTabEl === tabEl
});
if (tabContext) {
const tabState = tabContext.getTabState();
if (tabState) {
openTabs.push(tabState);
}
}
}
@@ -573,5 +572,6 @@ export default {
openEmptyTab,
noteDeleted,
refreshTabs,
noteChanged
noteChanged,
openTabsChanged
};