blacklight-frontend
Advanced tools
Comparing version 8.0.0-beta.1 to 8.0.0-beta.2
@@ -266,6 +266,11 @@ const Blacklight = function() { | ||
// Add the passed in contents to the modal and display it. | ||
modal.receiveAjax = function (contents) { | ||
modal.receiveAjax = function (contents) { | ||
const domparser = new DOMParser(); | ||
const dom = domparser.parseFromString(contents, "text/html"); | ||
const elements = dom.querySelectorAll(`${modal.containerSelector} > *`); | ||
// If there is a containerSelector on the document, use it's children. | ||
let elements = dom.querySelectorAll(`${modal.containerSelector} > *`); | ||
if (element.length == 0) { | ||
// If the containerSelector wasn't found, use the whole document | ||
elements = dom.querySelectorAll(`*`); | ||
} | ||
document.querySelector(`${modal.modalSelector} .modal-content`).replaceChildren(...elements); | ||
@@ -272,0 +277,0 @@ |
@@ -272,6 +272,11 @@ (function (global, factory) { | ||
// Add the passed in contents to the modal and display it. | ||
modal.receiveAjax = function (contents) { | ||
modal.receiveAjax = function (contents) { | ||
const domparser = new DOMParser(); | ||
const dom = domparser.parseFromString(contents, "text/html"); | ||
const elements = dom.querySelectorAll(`${modal.containerSelector} > *`); | ||
// If there is a containerSelector on the document, use it's children. | ||
let elements = dom.querySelectorAll(`${modal.containerSelector} > *`); | ||
if (element.length == 0) { | ||
// If the containerSelector wasn't found, use the whole document | ||
elements = dom.querySelectorAll(`*`); | ||
} | ||
document.querySelector(`${modal.modalSelector} .modal-content`).replaceChildren(...elements); | ||
@@ -278,0 +283,0 @@ |
{ | ||
"name": "blacklight-frontend", | ||
"version": "8.0.0-beta.1", | ||
"version": "8.0.0-beta.2", | ||
"description": "[![Build Status](https://travis-ci.com/projectblacklight/blacklight.png?branch=main)](https://travis-ci.com/projectblacklight/blacklight) [![Gem Version](https://badge.fury.io/rb/blacklight.png)](http://badge.fury.io/rb/blacklight) [![Coverage Status](https://coveralls.io/repos/github/projectblacklight/blacklight/badge.svg?branch=main)](https://coveralls.io/github/projectblacklight/blacklight?branch=main)", | ||
@@ -5,0 +5,0 @@ "main": "app/assets/javascripts/blacklight", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
104551
650
5