Minor fixes to caliBlur.js

- Add alt attributes to images
- Fix a broken tag
This commit is contained in:
jvoisin 2020-05-09 17:07:22 +02:00
parent 189243a9b0
commit 30c9aa3df9

View File

@ -140,9 +140,9 @@ if ( $( 'body.book' ).length > 0 ) {
// Sexy blurred backgrounds
cover = $( '.cover img' ).attr( 'src' );
$( '#loader + .container-fluid' )
.prepend( '<div class="blur-wrapper"></div' );
.prepend( '<div class="blur-wrapper"></div>' );
$( '.blur-wrapper' )
.prepend( '<div><img class="bg-blur" src="' + cover + '"></div>' );
.prepend( '<div><img alt="Blurred cover" class="bg-blur" src="' + cover + '"></div>' );
// Fix-up book detail headings
publisher = $( '.publishers p span' ).text().split( ':' );
@ -442,7 +442,7 @@ if ( $( 'body.author' ).length >0 ) {
cover = $( '.author-bio img' ).attr( 'src' );
$( '#loader + .container-fluid' )
.prepend( '<div class="blur-wrapper"></div>' );
$( '.blur-wrapper' ).prepend( '<img class="bg-blur" src="' + cover + '">' );
$( '.blur-wrapper' ).prepend( '<img alt="Blurred author bio" class="bg-blur" src="' + cover + '">' );
// Place undefined cover images inside container
if ( $( '.bg-blur[src="undefined"]' ).length > 0 ) {
$( '.bg-blur' ).before( '<div class="bg-blur undefined-img"></div>' );