mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-05 15:32:55 +02:00
fixed error in removing marker
This commit is contained in:
parent
ed82dfe736
commit
4cf8bbc161
9 changed files with 72 additions and 33 deletions
|
@ -403,6 +403,7 @@ EPUBJS.reader.ControlsController = function(book) {
|
|||
});
|
||||
|
||||
book.on('renderer:locationChanged', function(cfi){
|
||||
var cfiFragment = "#" + cfi;
|
||||
//-- Check if bookmarked
|
||||
var bookmarked = reader.isBookmarked(cfi);
|
||||
if(bookmarked === -1) { //-- Not bookmarked
|
||||
|
@ -416,8 +417,10 @@ EPUBJS.reader.ControlsController = function(book) {
|
|||
}
|
||||
|
||||
// Update the History Location
|
||||
if(reader.settings.history) {
|
||||
history.pushState({}, '', "#"+cfi);
|
||||
if(reader.settings.history &&
|
||||
window.location.hash != cfiFragment) {
|
||||
// Add CFI fragment to the history
|
||||
history.pushState({}, '', cfiFragment);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue