Skip to content

Commit

Permalink
Annotations: fix ODD selection for preview
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfgangmm committed Jan 26, 2024
1 parent 9ce0da9 commit d589e50
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions resources/scripts/annotations/annotations.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ window.addEventListener("WebComponentsReady", () => {
const occurrences = occurDiv.querySelector("ul");
const saveBtn = document.getElementById("form-save");
const refInput = document.querySelectorAll(".form-ref");
// const authorityDialog = document.getElementById("authority-dialog");
const nerDialog = document.getElementById("ner-dialog");
let autoSave = false;
let type = "";
let emptyElement = false;
let text = "";
let enablePreview = true;
let currentEntityInfo = null;
let previewOdd = "teipublisher";
const doc = view.getDocument();

function restoreAnnotations(doc, annotations) {
Expand Down Expand Up @@ -357,7 +357,7 @@ window.addEventListener("WebComponentsReady", () => {
}
resolve(json.content);
fetch(
`${endpoint}/api/preview?odd=${doc.odd}.odd&base=${encodeURIComponent(
`${endpoint}/api/preview?odd=${previewOdd}.odd&base=${encodeURIComponent(
endpoint
)}%2F`,
{
Expand Down Expand Up @@ -889,9 +889,9 @@ window.addEventListener("WebComponentsReady", () => {

// wire the ODD selector for the preview
const oddSelector = document.querySelector('pb-select-odd');
oddSelector.odd = doc.odd;
oddSelector.odd = previewOdd;
window.pbEvents.subscribe('pb-refresh', 'preview', (ev) => {
doc.odd = ev.detail.odd;
previewOdd = ev.detail.odd;
preview(view.annotations);
});
});

0 comments on commit d589e50

Please sign in to comment.