IMPR: CMS lightbox

This commit is contained in:
Tony Air 2023-02-20 16:56:31 +02:00
parent 40bd7f9601
commit 52d6dcaf3c
3 changed files with 35 additions and 2 deletions

View File

@ -9,13 +9,20 @@ export default ((W) => {
const loadLazyImages = () => {
console.log(`${NAME}: Load lazy images`)
const base = document.querySelector('base')
const baseURL = base ? base.getAttribute('href') : '/'
D.querySelectorAll('[data-lazy-src]').forEach((el) => {
el.classList.remove('empty')
const img = new ImageObject()
let imgURL = baseURL + el.getAttribute('data-lazy-src')
img.load(el.getAttribute('data-lazy-src'), el)
// remove double slash
imgURL = imgURL.replace(/([^:]\/)\/+/g, "$1")
img.load(imgURL, el)
.then((result) => {
el.setAttribute('src', result)
})

View File

@ -136,3 +136,29 @@ body.cms {
.cms table.grid-field__table tbody .col-bulkSelect {
position: relative;
}
.notifications-list {
.alert {
.btn-close {
display: none;
}
}
}
.btn-outline-primary,
.btn-primary {
color: #fff;
}
.visually-hidden,
.visually-hidden-focusable:not(:focus):not(:focus-within) {
position: absolute !important;
width: 1px !important;
height: 1px !important;
padding: 0 !important;
margin: -1px !important;
overflow: hidden !important;
clip: rect(0, 0, 0, 0) !important;
white-space: nowrap !important;
border: 0 !important;
}

View File

@ -229,7 +229,7 @@ const cfg = merge(common.webpack, {
reserved: ['$', 'jQuery', 'jquery'],
},
output: {
ecma: 5,
ecma: 6,
comments: false,
// Turned on because emoji and regex is not minified properly using default
// https://github.com/facebook/create-react-app/issues/2488