mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
fix setting theme on new canvas note
This commit is contained in:
parent
7d39d080f5
commit
d6931f7441
@ -153,7 +153,7 @@ export default class ExcalidrawTypeWidget extends TypeWidget {
|
|||||||
|
|
||||||
// before we load content into excalidraw, make sure excalidraw has loaded
|
// before we load content into excalidraw, make sure excalidraw has loaded
|
||||||
while (!this.excalidrawRef || !this.excalidrawRef.current) {
|
while (!this.excalidrawRef || !this.excalidrawRef.current) {
|
||||||
this.log("excalidrawRef not yet loeaded, sleep 200ms...");
|
console.log("excalidrawRef not yet loaded, sleep 200ms...");
|
||||||
await sleep(200);
|
await sleep(200);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -166,7 +166,9 @@ export default class ExcalidrawTypeWidget extends TypeWidget {
|
|||||||
if (this.excalidrawRef.current && noteComplement.content?.trim() === "") {
|
if (this.excalidrawRef.current && noteComplement.content?.trim() === "") {
|
||||||
const sceneData = {
|
const sceneData = {
|
||||||
elements: [],
|
elements: [],
|
||||||
appState: {},
|
appState: {
|
||||||
|
theme: this.themeStyle
|
||||||
|
},
|
||||||
collaborators: []
|
collaborators: []
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -379,7 +381,7 @@ export default class ExcalidrawTypeWidget extends TypeWidget {
|
|||||||
width: dimensions.width,
|
width: dimensions.width,
|
||||||
height: dimensions.height,
|
height: dimensions.height,
|
||||||
onPaste: (data, event) => {
|
onPaste: (data, event) => {
|
||||||
this.log("Verbose: excalidraw internal paste. No trilium action implemented.", data, event);
|
console.log("Verbose: excalidraw internal paste. No trilium action implemented.", data, event);
|
||||||
},
|
},
|
||||||
onChange: debounce(this.onChangeHandler, this.DEBOUNCE_TIME_ONCHANGEHANDLER),
|
onChange: debounce(this.onChangeHandler, this.DEBOUNCE_TIME_ONCHANGEHANDLER),
|
||||||
viewModeEnabled: false,
|
viewModeEnabled: false,
|
||||||
@ -423,22 +425,6 @@ export default class ExcalidrawTypeWidget extends TypeWidget {
|
|||||||
this.currentSceneVersion = this.getSceneVersion();
|
this.currentSceneVersion = this.getSceneVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* logs to console.log with some predefined title
|
|
||||||
*
|
|
||||||
* @param {...any} args
|
|
||||||
*/
|
|
||||||
log(...args) {
|
|
||||||
let title = '';
|
|
||||||
if (this.note) {
|
|
||||||
title = this.note.title;
|
|
||||||
} else {
|
|
||||||
title = this.noteId + "nt/na";
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log(title, "=", this.noteId, "==", ...args);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* replaces exlicraw.com with own assets
|
* replaces exlicraw.com with own assets
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user