mirror of https://github.com/kiwix/libkiwix.git
Add span in querySelector
Earlier querySelector for download button was returning a div, on which we called the getAttribute function hence returning null This now returns a <span> element which returns the correct link with getAttribute
This commit is contained in:
parent
45e9b76b19
commit
f6309bb4c8
|
@ -322,7 +322,7 @@
|
||||||
booksToDelete.forEach(book => {iso.remove(book);});
|
booksToDelete.forEach(book => {iso.remove(book);});
|
||||||
books.forEach((book) => {
|
books.forEach((book) => {
|
||||||
iso.insert(generateBookHtml(book, sort))
|
iso.insert(generateBookHtml(book, sort))
|
||||||
const downloadButton = document.querySelector(`[data-id="${getInnerHtml(book, 'id')}"] .book__download`);
|
const downloadButton = document.querySelector(`[data-id="${getInnerHtml(book, 'id')}"] .book__download span`);
|
||||||
if (downloadButton) {
|
if (downloadButton) {
|
||||||
insertModal(downloadButton);
|
insertModal(downloadButton);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue