blacklight-frontend
Advanced tools
Comparing version 8.0.0-beta.2 to 8.0.0-beta.3
@@ -244,6 +244,5 @@ const Blacklight = function() { | ||
// Called on fatal failure of ajax load, function returns content | ||
// to show to user in modal. Right now called only for extreme | ||
// network errors. | ||
modal.onFailure = function (jqXHR, textStatus, errorThrown) { | ||
console.error('Server error:', this.url, jqXHR.status, errorThrown); | ||
// to show to user in modal. Right now called only for network errors. | ||
modal.onFailure = function (error) { | ||
console.error('Server error:', this.url, error); | ||
@@ -253,3 +252,3 @@ const contents = `<div class="modal-header"> | ||
<button type="button" class="blacklight-modal-close btn-close close" data-dismiss="modal" data-bs-dismiss="modal" aria-label="Close"> | ||
<span aria-hidden="true">×</span> | ||
<span aria-hidden="true" class="visually-hidden">×</span> | ||
</button> | ||
@@ -259,3 +258,3 @@ </div> | ||
<p>Expected a successful response from the server, but got an error</p> | ||
<pre>${this.type} ${this.url}\n${jqXHR.status}: ${errorThrown}</pre> | ||
<pre>${this.url}\n${error}</pre> | ||
</div>`; | ||
@@ -272,8 +271,9 @@ | ||
const dom = domparser.parseFromString(contents, "text/html"); | ||
// If there is a containerSelector on the document, use it's children. | ||
// If there is a containerSelector on the document, use its children. | ||
let elements = dom.querySelectorAll(`${modal.containerSelector} > *`); | ||
if (element.length == 0) { | ||
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); | ||
@@ -389,2 +389,3 @@ | ||
SearchContext, | ||
Core: Blacklight, | ||
onLoad: Blacklight.onLoad | ||
@@ -391,0 +392,0 @@ }; |
@@ -250,6 +250,5 @@ (function (global, factory) { | ||
// Called on fatal failure of ajax load, function returns content | ||
// to show to user in modal. Right now called only for extreme | ||
// network errors. | ||
modal.onFailure = function (jqXHR, textStatus, errorThrown) { | ||
console.error('Server error:', this.url, jqXHR.status, errorThrown); | ||
// to show to user in modal. Right now called only for network errors. | ||
modal.onFailure = function (error) { | ||
console.error('Server error:', this.url, error); | ||
@@ -259,3 +258,3 @@ const contents = `<div class="modal-header"> | ||
<button type="button" class="blacklight-modal-close btn-close close" data-dismiss="modal" data-bs-dismiss="modal" aria-label="Close"> | ||
<span aria-hidden="true">×</span> | ||
<span aria-hidden="true" class="visually-hidden">×</span> | ||
</button> | ||
@@ -265,3 +264,3 @@ </div> | ||
<p>Expected a successful response from the server, but got an error</p> | ||
<pre>${this.type} ${this.url}\n${jqXHR.status}: ${errorThrown}</pre> | ||
<pre>${this.url}\n${error}</pre> | ||
</div>`; | ||
@@ -278,8 +277,9 @@ | ||
const dom = domparser.parseFromString(contents, "text/html"); | ||
// If there is a containerSelector on the document, use it's children. | ||
// If there is a containerSelector on the document, use its children. | ||
let elements = dom.querySelectorAll(`${modal.containerSelector} > *`); | ||
if (element.length == 0) { | ||
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); | ||
@@ -395,2 +395,3 @@ | ||
SearchContext, | ||
Core: Blacklight, | ||
onLoad: Blacklight.onLoad | ||
@@ -397,0 +398,0 @@ }; |
{ | ||
"name": "blacklight-frontend", | ||
"version": "8.0.0-beta.2", | ||
"version": "8.0.0-beta.3", | ||
"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
104111