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:
parent
1968812814
commit
236f8277f7
2 changed files with 11 additions and 5 deletions
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue