diff --git a/themes/bootstrap3/js/check_item_statuses.js b/themes/bootstrap3/js/check_item_statuses.js index dac8cf8ca8f1..4c93a51d919b 100644 --- a/themes/bootstrap3/js/check_item_statuses.js +++ b/themes/bootstrap3/js/check_item_statuses.js @@ -45,7 +45,7 @@ VuFind.register('itemStatuses', function ItemStatuses() { ) { // Full status mode is on -- display the HTML and hide extraneous junk: callnumAndLocations.forEach((callnumAndLocation) => { - callnumAndLocation.innerHTML = VuFind.updateCspNonce(result.full_status); + VuFind.setElementContents(callnumAndLocation, VuFind.updateCspNonce(result.full_status)); }); el.querySelectorAll('.callnumber,.hideIfDetailed,.location,.status').forEach((e) => { e.classList.add('hidden'); }); } else if (typeof(result.missing_data) !== 'undefined' diff --git a/themes/bootstrap3/js/hierarchy_tree.js b/themes/bootstrap3/js/hierarchy_tree.js index 1fbe143b1468..1e3348467fa4 100644 --- a/themes/bootstrap3/js/hierarchy_tree.js +++ b/themes/bootstrap3/js/hierarchy_tree.js @@ -25,7 +25,7 @@ VuFind.register('hierarchyTree', function HierarchyTree() { const queryParams = new URLSearchParams({id: id, source: treeEl.dataset.source}); fetch(VuFind.path + '/Hierarchy/GetRecord?' + queryParams.toString()) .then((response) => response.text()) - .then((content) => recordEl.innerHTML = VuFind.updateCspNonce(content) ); + .then((content) => VuFind.setElementContents(recordEl, VuFind.updateCspNonce(content)) ); return true; } @@ -239,7 +239,7 @@ VuFind.register('hierarchyTree', function HierarchyTree() { if (loadIndicatorEl) { loadIndicatorEl.classList.add('hidden'); } - treePlaceholderEl.outerHTML = VuFind.updateCspNonce(json.html); + VuFind.setElementContents(treePlaceholderEl, VuFind.updateCspNonce(json.html), 'outerHTML'); setupTree(containerEl); }) .catch(() => { diff --git a/themes/bootstrap5/js/check_item_statuses.js b/themes/bootstrap5/js/check_item_statuses.js index dac8cf8ca8f1..4c93a51d919b 100644 --- a/themes/bootstrap5/js/check_item_statuses.js +++ b/themes/bootstrap5/js/check_item_statuses.js @@ -45,7 +45,7 @@ VuFind.register('itemStatuses', function ItemStatuses() { ) { // Full status mode is on -- display the HTML and hide extraneous junk: callnumAndLocations.forEach((callnumAndLocation) => { - callnumAndLocation.innerHTML = VuFind.updateCspNonce(result.full_status); + VuFind.setElementContents(callnumAndLocation, VuFind.updateCspNonce(result.full_status)); }); el.querySelectorAll('.callnumber,.hideIfDetailed,.location,.status').forEach((e) => { e.classList.add('hidden'); }); } else if (typeof(result.missing_data) !== 'undefined' diff --git a/themes/bootstrap5/js/hierarchy_tree.js b/themes/bootstrap5/js/hierarchy_tree.js index 1fbe143b1468..1e3348467fa4 100644 --- a/themes/bootstrap5/js/hierarchy_tree.js +++ b/themes/bootstrap5/js/hierarchy_tree.js @@ -25,7 +25,7 @@ VuFind.register('hierarchyTree', function HierarchyTree() { const queryParams = new URLSearchParams({id: id, source: treeEl.dataset.source}); fetch(VuFind.path + '/Hierarchy/GetRecord?' + queryParams.toString()) .then((response) => response.text()) - .then((content) => recordEl.innerHTML = VuFind.updateCspNonce(content) ); + .then((content) => VuFind.setElementContents(recordEl, VuFind.updateCspNonce(content)) ); return true; } @@ -239,7 +239,7 @@ VuFind.register('hierarchyTree', function HierarchyTree() { if (loadIndicatorEl) { loadIndicatorEl.classList.add('hidden'); } - treePlaceholderEl.outerHTML = VuFind.updateCspNonce(json.html); + VuFind.setElementContents(treePlaceholderEl, VuFind.updateCspNonce(json.html), 'outerHTML'); setupTree(containerEl); }) .catch(() => {