From 888365e2e44845485af8ae50dc3163e919fc3a63 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 29 Jun 2018 14:58:52 +0300 Subject: add resized handler --- read.html | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'read.html') diff --git a/read.html b/read.html index 9cc523f..50f660b 100644 --- a/read.html +++ b/read.html @@ -226,8 +226,7 @@ @@ -817,6 +816,19 @@ rendition.on("keyup", hotkey_handler); + rendition.on('resized', function() { + console.log('resized'); + + $(".loading").show(); + $(".loading_message").html("Opening chapter..."); + + window.setTimeout(function() { + open_lastread(); + + $(".loading").hide(); + }, 250); + }); + rendition.on('rendered', function(chapter) { $(".chapter").html(""); @@ -868,8 +880,6 @@ var totalPages = 100; var pct = book.locations.percentageFromCfi(currentCfi); - $("#cur_page").html(currentPage); - $("#total_pages").html(totalPages); $("#page_pct").html(parseInt(pct*100) + '%'); if (_store_position && new Date().getTime()/1000 - _last_position_sync > 15) { -- cgit v1.2.3