function offline_remove2(elem) { return offline_remove(elem, populate_list); } function populate_list() { var books = $("#books_container"); books.html(""); localforage.iterate(function(value, key, i) { if (key.match(/epube-book\.\d{1,}$/)) { Promise.all([ localforage.getItem(key), localforage.getItem(key + ".cover"), localforage.getItem(key + ".lastread") ]).then(function(results) { var info = results[0]; if (info) { var cover = false; if (results && results[1]) { cover = URL.createObjectURL(results[1]); } var in_progress = false; var is_read = false; var lastread = results[2]; if (lastread) { in_progress = lastread.page > 0; is_read = lastread.total > 0 && lastread.total - lastread.page < 5; } var cell = "