narrative : fix data fetching (build URL from location)
All checks were successful
Deploy / Build and Deploy to Production (push) Successful in 17s
All checks were successful
Deploy / Build and Deploy to Production (push) Successful in 17s
This commit is contained in:
parent
ccaec7cfed
commit
4d1183d1af
2 changed files with 6 additions and 12 deletions
|
|
@ -12,8 +12,6 @@ import Coloris from '@melloware/coloris';
|
|||
const stylesheetStore = useStylesheetStore();
|
||||
const narrativeStore = useNarrativeStore();
|
||||
|
||||
// Get narrative URL from body data attribute (set by print.php template)
|
||||
const narrativeUrl = document.body.dataset.narrativeUrl || null;
|
||||
const previewFrame1 = ref(null);
|
||||
const previewFrame2 = ref(null);
|
||||
const elementPopup = ref(null);
|
||||
|
|
@ -28,8 +26,6 @@ const selectedPages = ref([]); // Pages with active border (when popup is open)
|
|||
const hoveredElement = ref(null); // Currently hovered content element
|
||||
const selectedElement = ref(null); // Selected element (when popup is open)
|
||||
const EDGE_THRESHOLD = 30; // px from edge to trigger hover
|
||||
const PAGE_HIGHLIGHT_COLOR = '#ff8a50';
|
||||
const ELEMENT_HIGHLIGHT_COLOR = '#7136ff';
|
||||
|
||||
let savedScrollPercentage = 0;
|
||||
const currentFrameIndex = ref(1); // 1 or 2, which iframe is currently visible
|
||||
|
|
@ -559,9 +555,7 @@ const printPreview = async () => {
|
|||
|
||||
onMounted(async () => {
|
||||
// Load narrative data if URL is provided (print mode)
|
||||
if (narrativeUrl) {
|
||||
await narrativeStore.loadNarrative(narrativeUrl);
|
||||
}
|
||||
await narrativeStore.loadNarrative(location.href + '.json');
|
||||
|
||||
// Render preview after data is loaded
|
||||
renderPreview(true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue