mirror of
https://github.com/zadam/trilium.git
synced 2025-11-17 18:50:41 +01:00
fix access to editor instance if active note is not text
This commit is contained in:
@@ -85,6 +85,17 @@ function getActiveComponent() {
|
||||
return getActiveTabContext().getComponent();
|
||||
}
|
||||
|
||||
function getActiveEditor() {
|
||||
const activeTabContext = getActiveTabContext();
|
||||
|
||||
if (activeTabContext && activeTabContext.note && activeTabContext.note.type === 'text') {
|
||||
return activeTabContext.getComponent().getEditor();
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function getTabContexts() {
|
||||
return tabContexts;
|
||||
}
|
||||
@@ -482,6 +493,7 @@ export default {
|
||||
getTabContext,
|
||||
getTabContexts,
|
||||
getActiveTabContext,
|
||||
getActiveEditor,
|
||||
isActive,
|
||||
activateTabContext,
|
||||
getActiveComponent,
|
||||
|
||||
Reference in New Issue
Block a user