1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-03 14:59:18 +02:00

Update isFloat util to handle strings

This commit is contained in:
Fred Chasen 2018-06-14 14:11:40 -07:00
parent 1968812814
commit 236f8277f7
2 changed files with 11 additions and 5 deletions

View file

@ -306,10 +306,7 @@ class Rendition {
this.displaying = displaying;
// Check if this is a book percentage
if (this.book.locations.length() &&
(isFloat(target) ||
(target === "1.0")) // Handle 1.0
) {
if (this.book.locations.length() && isFloat(target)) {
target = this.book.locations.cfiFromPercentage(parseFloat(target));
}