Skip to content

Commit

Permalink
Merge pull request #2968 from projectblacklight/child-nodes
Browse files Browse the repository at this point in the history
Select the childNodes of the ajax response
  • Loading branch information
jcoyne committed Jan 31, 2023
2 parents a02c85d + 96e043d commit 402377e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion app/assets/javascripts/blacklight/blacklight.esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/assets/javascripts/blacklight/blacklight.esm.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion app/assets/javascripts/blacklight/blacklight.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/assets/javascripts/blacklight/blacklight.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion app/javascript/blacklight/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,9 @@ const Modal = (() => {
let elements = dom.querySelectorAll(`${modal.containerSelector} > *`)
if (elements.length == 0) {
// If the containerSelector wasn't found, use the whole document
elements = dom.querySelectorAll(`*`)
elements = dom.body.childNodes
}

document.querySelector(`${modal.modalSelector} .modal-content`).replaceChildren(...elements)

modal.show();
Expand Down

0 comments on commit 402377e

Please sign in to comment.