Skip to content

Commit

Permalink
avoid elementPosition variable to be undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
daliboris committed Aug 10, 2024
1 parent 7b9cda3 commit 72b58bb
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions resources/scripts/annotations/annotations.js
Original file line number Diff line number Diff line change
Expand Up @@ -417,17 +417,15 @@ window.addEventListener("WebComponentsReady", () => {
query: selection
});
}
emptyElement = false;
elementPosition = "around";
if (button.classList.contains("after")) {
elementPosition = "after";
}
if (button.classList.contains("before")) {
elementPosition = "before";
}
//if class contains 'before' or 'after' value, it's an empty element
if (elementPosition != "around") {
emptyElement = true;
}
emptyElement = (elementPosition != "around");
window.pbEvents.emit("show-annotation", "transcription", {});
showForm(type);
text = selection;
Expand Down Expand Up @@ -651,7 +649,8 @@ window.addEventListener("WebComponentsReady", () => {
if (trackHistory) {
document.dispatchEvent(new CustomEvent('pb-before-save', {
detail: {
user: currentUser
user: currentUser,
export: false
}
}));
} else {
Expand Down

0 comments on commit 72b58bb

Please sign in to comment.