Skip to content

Commit

Permalink
Fix setPrintBtnHash when print button is not present.
Browse files Browse the repository at this point in the history
  • Loading branch information
EreMaijala committed Nov 4, 2024
1 parent e8161e4 commit d71aca6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions themes/bootstrap3/js/record.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ function registerTabEvents() {
// Update print button to correct tab prints
function setPrintBtnHash(hash) {
let printBtn = document.querySelector(".print-record");
if (!printBtn) {
return;
}
let printHref = printBtn.getAttribute("href");
let printURL = new URL(printHref, window.location.origin);
printURL.hash = hash === null ? "" : hash;
Expand Down
3 changes: 3 additions & 0 deletions themes/bootstrap5/js/record.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ function registerTabEvents() {
// Update print button to correct tab prints
function setPrintBtnHash(hash) {
let printBtn = document.querySelector(".print-record");
if (!printBtn) {
return;
}
let printHref = printBtn.getAttribute("href");
let printURL = new URL(printHref, window.location.origin);
printURL.hash = hash === null ? "" : hash;
Expand Down

0 comments on commit d71aca6

Please sign in to comment.