Added placeholder image for unknown covers
This commit is contained in:
parent
4919486f10
commit
098c977d94
|
@ -69,8 +69,15 @@ class TPDF {
|
||||||
|
|
||||||
|
|
||||||
titleElement.appendChild(document.createTextNode(results['books'][i]['title']));
|
titleElement.appendChild(document.createTextNode(results['books'][i]['title']));
|
||||||
coverElement.src = 'output/images/' + results['books'][i]['cover'];
|
if (results['books'][i]['cover'] != undefined) {
|
||||||
coverElement.alt = 'Cover of «' + results['books'][i]['title'] + '»';
|
coverElement.src = 'output/images/' + results['books'][i]['cover'];
|
||||||
|
coverElement.alt = 'Cover of «' + results['books'][i]['title'] + '»';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
coverElement.src = 'frontend/placeholder.png';
|
||||||
|
coverElement.alt = '[no image]';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bookElement.appendChild(titleElement);
|
bookElement.appendChild(titleElement);
|
||||||
bookElement.appendChild(coverElement);
|
bookElement.appendChild(coverElement);
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
Loading…
Reference in New Issue