Merge remote-tracking branch 'adv/bookmarks'

This commit is contained in:
OzzieIsaacs 2017-09-17 20:26:58 +02:00
commit 378a0ca662
2 changed files with 7 additions and 7 deletions

View File

@ -8,7 +8,7 @@
var reader = ePubReader(calibre.bookUrl, {
restore: true,
bookmarks: [calibre.bookmark]
bookmarks: calibre.bookmark ? [calibre.bookmark] : []
});
reader.on("reader:bookmarked", updateBookmark.bind(reader, "add"));
reader.on("reader:unbookmarked", updateBookmark.bind(reader, "remove"));
@ -21,7 +21,7 @@
// Remove other bookmarks (there can only be one)
if (action === "add") {
this.settings.bookmarks.filter(function (bookmark) {
return bookmark !== location;
return bookmark && bookmark !== location;
}).map(function (bookmark) {
this.removeBookmark(bookmark);
}.bind(this));

View File

@ -20,24 +20,24 @@
<!--a id="show-Search" class="show_view icon-search" data-view="Search">Search</a-->
<a id="show-Toc" class="show_view icon-list-1 active" data-view="Toc">TOC</a>
<a id="show-Bookmarks" class="show_view icon-bookmark" data-view="Bookmarks">Bookmarks</a>
<a id="show-Notes" class="show_view icon-edit" data-view="Notes">Notes</a>
<!--a id="show-Notes" class="show_view icon-edit" data-view="Notes">Notes</a-->
</div>
<div id="tocView" class="view">
</div>
<div id="searchView" class="view">
<!--div id="searchView" class="view">
<ul id="searchResults"></ul>
</div>
</div-->
<div id="bookmarksView" class="view">
<ul id="bookmarks"></ul>
</div>
<div id="notesView" class="view">
<!--div id="notesView" class="view">
<div id="new-note">
<textarea id="note-text"></textarea>
<button id="note-anchor">Anchor</button>
</div>
<ol id="notes"></ol>
</div>
</div-->
</div>
<div id="main">