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

check that cfi is string before finding indexOf

This commit is contained in:
Fred Chasen 2015-06-05 09:12:54 -04:00
parent ac926479cf
commit d896d8c228
4 changed files with 9 additions and 5 deletions

6
dist/epub.js vendored
View file

@ -5227,7 +5227,8 @@ EPUBJS.Rendition.prototype._display = function(target){
var view;
var cfi, spinePos;
if(target.indexOf("epubcfi(") === 0) {
if(typeof target === "string" &&
target.indexOf("epubcfi(") === 0) {
cfi = new EPUBJS.EpubCFI(target);
spinePos = cfi.spinePos;
section = this.book.spine.get(spinePos);
@ -5703,7 +5704,8 @@ EPUBJS.Continuous.prototype._display = function(target){
var view;
var cfi, spinePos;
if(target.indexOf("epubcfi(") === 0) {
if(typeof target === "string" &&
target.indexOf("epubcfi(") === 0) {
cfi = new EPUBJS.EpubCFI(target);
spinePos = cfi.spinePos;
section = this.book.spine.get(spinePos);

2
dist/epub.min.js vendored

File diff suppressed because one or more lines are too long

View file

@ -48,7 +48,8 @@ EPUBJS.Continuous.prototype._display = function(target){
var view;
var cfi, spinePos;
if(target.indexOf("epubcfi(") === 0) {
if(typeof target === "string" &&
target.indexOf("epubcfi(") === 0) {
cfi = new EPUBJS.EpubCFI(target);
spinePos = cfi.spinePos;
section = this.book.spine.get(spinePos);

View file

@ -169,7 +169,8 @@ EPUBJS.Rendition.prototype._display = function(target){
var view;
var cfi, spinePos;
if(target.indexOf("epubcfi(") === 0) {
if(typeof target === "string" &&
target.indexOf("epubcfi(") === 0) {
cfi = new EPUBJS.EpubCFI(target);
spinePos = cfi.spinePos;
section = this.book.spine.get(spinePos);