Skip to content

Commit

Permalink
Fix Export on Chrome
Browse files Browse the repository at this point in the history
  • Loading branch information
ltouroumov committed Oct 17, 2024
1 parent 79b8015 commit b57bace
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
16 changes: 10 additions & 6 deletions components/viewer/modal/BackpackModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ import { useProjectRefs, useProjectStore } from '~/composables/store/project';
import { useSettingRefs, useSettingStore } from '~/composables/store/settings';
import { useViewerRefs, useViewerStore } from '~/composables/store/viewer';
const config = useRuntimeConfig();
const { project } = useProjectStore();
const { selected } = useProjectRefs();
const { toggleBackpack } = useViewerStore();
Expand Down Expand Up @@ -209,15 +210,18 @@ const copyStyles = (sourceDoc: Document, targetDoc: Document): void => {
};
const backpackToHtml = async () => {
const wRef = window.open('', '_blank');
const exportPage = `${config.app.baseURL}export.html`;
const wRef = window.open(exportPage, '_blank');
if (!wRef) return;
const wDoc = wRef.window.document;
copyStyles(window.document, wDoc);
wDoc.body.setAttribute('data-bs-theme', 'dark');
wRef.addEventListener('load', () => {
const wDoc = wRef.window.document;
copyStyles(window.document, wDoc);
wDoc.body.setAttribute('data-bs-theme', 'dark');
const vNode = h(BackpackExportWrapper, {});
render(vNode, wDoc.body);
const vNode = h(BackpackExportWrapper, {});
render(vNode, wDoc.body);
});
};
</script>

Expand Down
1 change: 0 additions & 1 deletion components/viewer/modal/notes/NotesView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ const visiblePackRows = computed((): PackRow[] => {
return has(`obj:${obj.id}`, _buildNotes);
}, item.choices);
console.log(item.packRow.id, hasNote, choices);
if (isEmpty(choices) && !hasNote) {
return [];
} else {
Expand Down
4 changes: 4 additions & 0 deletions public/export.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<html>
<head></head>
<body></body>
</html>

0 comments on commit b57bace

Please sign in to comment.