summaryrefslogtreecommitdiff
path: root/js/index.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2019-03-15 13:54:02 +0300
committerAndrew Dolgov <[email protected]>2019-03-15 13:54:02 +0300
commit4f1c7a977ba958b6def28b2ca42bcaef83286e4f (patch)
treeb8b5bc67ae31963170ab8224bf0a3bbc4e278d28 /js/index.js
parent0d01e871012b85936a9a5d64082dcf551499e2b0 (diff)
code/layout cleanup
Diffstat (limited to 'js/index.js')
-rw-r--r--js/index.js18
1 files changed, 17 insertions, 1 deletions
diff --git a/js/index.js b/js/index.js
index a16dd44..5bafdca 100644
--- a/js/index.js
+++ b/js/index.js
@@ -91,6 +91,22 @@ function mark_offline_books() {
});
}
+/* exported show_covers */
+function show_covers() {
+ $("img[data-cover-link]").each((i,e) => {
+ e = $(e);
+
+ const img = $("<img>")
+ .on("load", function() {
+ e.css("background-image", "url(" + e.attr('data-cover-link') + ")")
+ e.fadeIn();
+
+ img.attr("src", null);
+ })
+ .attr("src", e.attr('data-cover-link'));
+ });
+}
+
function offline_cache(bookId, callback) {
console.log("offline cache: " + bookId);
@@ -187,7 +203,7 @@ function offline_get_all() {
if (confirm("Download all books on this page?")) {
- $(".index_cell").each(function (i, row) {
+ $(".row > div").each(function (i, row) {
const bookId = $(row).attr("id").replace("cell-", "");
const dropitem = $(row).find(".offline_dropitem")[0];