mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-04 15:09:16 +02:00
small fixes
This commit is contained in:
parent
f1da229989
commit
4c5235162e
5 changed files with 21 additions and 16 deletions
BIN
.DS_Store
vendored
BIN
.DS_Store
vendored
Binary file not shown.
|
@ -222,7 +222,7 @@ FPR.app.init = (function($){
|
|||
});
|
||||
|
||||
function showSidebar(){
|
||||
$book.css("pointer-events", "none"); //-- Avoid capture by ifrmae
|
||||
//$book.css("pointer-events", "none"); //-- Avoid capture by ifrmae
|
||||
$sidebar.addClass("open");
|
||||
$main.addClass("closed");
|
||||
$icon.attr("src", "img/close.png");
|
||||
|
@ -241,9 +241,9 @@ FPR.app.init = (function($){
|
|||
}else{
|
||||
showSidebar();
|
||||
|
||||
$open.clickOutside(function(){
|
||||
hideSidebar();
|
||||
});
|
||||
// $open.clickOutside(function(){
|
||||
// hideSidebar();
|
||||
// });
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -468,7 +468,6 @@ FP.Book.prototype.startDisplay = function(chapter){
|
|||
var routed,
|
||||
prevChapter = this.spinePos,
|
||||
loaded = function(chapter){
|
||||
|
||||
//-- If there is a saved page, and the pages haven't changed go to it
|
||||
if( this.prevChapterPos
|
||||
&& prevChapter == chapter.pos
|
||||
|
@ -487,7 +486,7 @@ FP.Book.prototype.startDisplay = function(chapter){
|
|||
|
||||
//-- Go to hashed page if present
|
||||
if(this.useHash){
|
||||
routed = this.route(loaded);
|
||||
routed = this.route(false, loaded);
|
||||
}
|
||||
|
||||
if(!this.useHash || !routed){
|
||||
|
@ -655,7 +654,7 @@ FP.Book.prototype.determineStorageMethod = function(override) {
|
|||
FP.storage.storageMethod(method);
|
||||
}
|
||||
|
||||
FP.Book.prototype.route = function(callback){
|
||||
FP.Book.prototype.route = function(hash, callback){
|
||||
var location = window.location.hash.replace('#/', '');
|
||||
if(this.useHash && location.length && location != this.prevLocation){
|
||||
this.show(location, callback);
|
||||
|
|
|
@ -207,16 +207,22 @@ FP.Chapter.prototype.replaceLinks = function(callback){
|
|||
relative = href.search("://"),
|
||||
fragment = href[0] == "#";
|
||||
|
||||
if(relative != -1) return; //-- Only replace relative links
|
||||
if(relative != -1){
|
||||
|
||||
link.onclick = function(){
|
||||
if(that.book.useHash){
|
||||
window.location.hash = "#/"+href;
|
||||
}else{
|
||||
that.book.show(href);
|
||||
link.setAttribute("target", "_blank");
|
||||
|
||||
}else{
|
||||
|
||||
link.onclick = function(){
|
||||
if(that.book.useHash){
|
||||
window.location.hash = "#/"+href;
|
||||
}else{
|
||||
that.book.show(href);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
if(callback) callback();
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
"use strict";
|
||||
|
||||
var FP = FP || {};
|
||||
FP.VERSION = "0.1.3";
|
||||
FP.VERSION = "0.1.4";
|
||||
|
||||
document.onreadystatechange = function () {
|
||||
if (document.readyState == "complete") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue