Skip to content

Commit

Permalink
Merge pull request #261 from codex-team/fix-covers
Browse files Browse the repository at this point in the history
fix(covers): cover sending fix
  • Loading branch information
neSpecc authored Jul 13, 2024
2 parents 3dab6d4 + 26e909a commit 6a65050
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions codex-ui/src/vue/components/editor/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ defineExpose({
isEmpty(): boolean {
return isEmpty.value;
},
/**
* Returns the editor holder
*/
element: editorComponent.value,
});
</script>

Expand Down
4 changes: 4 additions & 0 deletions src/infrastructure/utils/screenshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ export async function makeElementScreenshot(element: HTMLElement, containerStyle
*/
const screenshotContainer = document.createElement('div');

screenshotContainer.setAttribute('color-scheme', 'dark');
screenshotContainer.setAttribute('theme-base', 'graphite');
screenshotContainer.setAttribute('theme-accent', 'sky');

/**
* Assign passed styles to container
*/
Expand Down
3 changes: 2 additions & 1 deletion src/presentation/pages/Note.vue
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ async function noteChanged(data: NoteContent): Promise<void> {
/**
* Get html element with note
*/
const editorElement = document.getElementById('editorjs');
const editorElement = editor.value ? editor.value.element : null;
if (!isEmpty) {
await save(data, props.parentId);
Expand All @@ -133,6 +133,7 @@ async function noteChanged(data: NoteContent): Promise<void> {
if (editorElement !== null) {
updatedNoteCover = await makeElementScreenshot(editorElement, {
background: 'var(--base--bg-primary)',
color: 'var(--base--text)',
display: 'flex',
justifyContent: 'center',
width: '1200px',
Expand Down

0 comments on commit 6a65050

Please sign in to comment.