safely ignore unknown directions
This commit is contained in:
parent
bfc364fe4b
commit
50b9883f99
2 changed files with 9 additions and 6 deletions
|
@ -469,10 +469,11 @@ async function processScrolls(svg: XMLDocument): Promise<VideoScrollDef[]> {
|
||||||
direction as VideoScrollDirection
|
direction as VideoScrollDirection
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
throw new Error(`Unknown direction string: "${direction}"`);
|
console.error(`Unknown direction definition: "${direction}"`);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
return direction as VideoScrollDirection;
|
return direction as VideoScrollDirection;
|
||||||
});
|
}).filter((d) => Boolean(d)) as VideoScrollDirection[];
|
||||||
|
|
||||||
console.debug(`[SVG/VIDEOSCROLLS] Fetching ${filesURL}...`);
|
console.debug(`[SVG/VIDEOSCROLLS] Fetching ${filesURL}...`);
|
||||||
const fileFetch = await fetch(`content/${filesURL}`);
|
const fileFetch = await fetch(`content/${filesURL}`);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="video-scroll" ref="root">
|
<div class="video-scroll" ref="root" v-if="definition.directions.length > 0">
|
||||||
<img class="visible displayed loaded"
|
<img class="visible displayed loaded"
|
||||||
:src="definition.files[0]"
|
:src="definition.files[0]"
|
||||||
:style="{
|
:style="{
|
||||||
|
@ -93,10 +93,12 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
if (this.$refs.root){
|
||||||
Array.from((this.$refs.root as Element).children).forEach((el) => {
|
Array.from((this.$refs.root as Element).children).forEach((el) => {
|
||||||
observer.observe(el);
|
observer.observe(el);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export enum VideoScrollDirection {
|
export enum VideoScrollDirection {
|
||||||
|
|
Loading…
Reference in a new issue