mirror of
https://github.com/zadam/trilium.git
synced 2025-11-15 17:55:52 +01:00
keyboard handlers for tabs
This commit is contained in:
@@ -24,7 +24,7 @@ class AttributesWidget extends StandardWidget {
|
||||
}
|
||||
|
||||
async refreshWithNote() {
|
||||
const attributes = await this.tabContext.attributes.getAttributes();console.log("attributes", attributes);
|
||||
const attributes = await this.tabContext.attributes.getAttributes();
|
||||
const ownedAttributes = attributes.filter(attr => attr.noteId === this.tabContext.note.noteId);
|
||||
|
||||
if (attributes.length === 0) {
|
||||
|
||||
@@ -64,7 +64,7 @@ class NoteInfoWidget extends StandardWidget {
|
||||
}
|
||||
|
||||
syncDataListener({data}) {
|
||||
if (data.find(sd => sd.entityName === 'notes' && sd.entityId === this.tabContext.note.noteId)) {
|
||||
if (data.find(sd => sd.entityName === 'notes' && this.isNote(sd.entityId))) {
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -473,6 +473,10 @@ export default class TabRowWidget extends BasicWidget {
|
||||
tabEl.setAttribute('active', '');
|
||||
}
|
||||
|
||||
tabOpenedListener({tabId}) {
|
||||
this.addTab(tabId);
|
||||
}
|
||||
|
||||
removeTab(tabId) {
|
||||
const tabEl = this.getTabById(tabId)[0];
|
||||
|
||||
@@ -595,7 +599,7 @@ export default class TabRowWidget extends BasicWidget {
|
||||
if (destinationIndex < originIndex) {
|
||||
tabEl.parentNode.insertBefore(tabEl, this.tabEls[destinationIndex]);
|
||||
} else {
|
||||
const beforeEl = this.tabEls[destinationIndex + 1] || this.$newTab;
|
||||
const beforeEl = this.tabEls[destinationIndex + 1] || this.$newTab[0];
|
||||
|
||||
tabEl.parentNode.insertBefore(tabEl, beforeEl);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user