Skip to content

Commit 66de500

Browse files
Write defaultTheme to theme when exporting
1 parent 497931b commit 66de500

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/_shared/frametrail-core/storage/StorageAdapterDownload.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,14 @@ class StorageAdapterDownload extends StorageAdapter {
8080
: '';
8181
var cdnBase = 'https://cdn.jsdelivr.net/npm/@frametrail/frametrail' + version + '/';
8282

83+
// If the hypervideo has no per-hypervideo theme, write the global defaultTheme
84+
// into the exported data so the standalone HTML uses the correct theme.
85+
var hvConfig = Database.hypervideos[hypervideoID] && Database.hypervideos[hypervideoID].config;
86+
if (hvConfig && !hvConfig.theme && fullConfig.defaultTheme) {
87+
hvData.config = hvData.config || {};
88+
hvData.config.theme = fullConfig.defaultTheme;
89+
}
90+
8391
var annotations = Database.getAnnotationsW3C();
8492
var contentItem = { hypervideo: hvData };
8593
if (annotations.length > 0) {

0 commit comments

Comments
 (0)