From 706654627fce032fa1378125bcec3dba3133a187 Mon Sep 17 00:00:00 2001 From: joshuastegmaier Date: Wed, 14 Aug 2024 09:38:13 -0400 Subject: [PATCH] Changed vendor scripts in asset_detail to be modules. Moved explicit split.js import to viewer-split.js and removed script tag for it. --- concordia/static/js/src/viewer-split.js | 15 +++++++-------- .../templates/transcriptions/asset_detail.html | 5 ++--- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/concordia/static/js/src/viewer-split.js b/concordia/static/js/src/viewer-split.js index 7c358f943..f425121b8 100644 --- a/concordia/static/js/src/viewer-split.js +++ b/concordia/static/js/src/viewer-split.js @@ -1,6 +1,5 @@ -/* global Split */ - import {seadragonViewer} from './viewer.js'; +import Split from '/static/split.js/dist/split.es.js'; let pageSplit; let contributeContainer = document.getElementById('contribute-container'); @@ -109,6 +108,12 @@ function horizontalSplit() { }); } +if (splitDirection == 'v') { + pageSplit = verticalSplit(); +} else { + pageSplit = horizontalSplit(); +} + document .getElementById('viewer-layout-horizontal') .addEventListener('click', function () { @@ -140,9 +145,3 @@ document }, 10); } }); - -if (splitDirection == 'v') { - pageSplit = verticalSplit(); -} else { - pageSplit = horizontalSplit(); -} diff --git a/concordia/templates/transcriptions/asset_detail.html b/concordia/templates/transcriptions/asset_detail.html index 7039ae6c6..0cb1144c6 100644 --- a/concordia/templates/transcriptions/asset_detail.html +++ b/concordia/templates/transcriptions/asset_detail.html @@ -31,9 +31,8 @@ data-tile-source-url="{% asset_media_url asset %}?canvas" > - - - + +