Skip to content

Commit

Permalink
Fix: Manga mode not working in epub
Browse files Browse the repository at this point in the history
  • Loading branch information
ollm committed Jan 14, 2024
1 parent fa3d819 commit a901754
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
##### 🐛 Bug Fixes

- node-zstd not have native dependencies in arm64 build (Linux and macOS)
- Manga mode not working in epub

## [v1.1.0](https://github.com/ollm/OpenComic/releases/tag/v1.1.0) (13-01-2024)

Expand Down
15 changes: 13 additions & 2 deletions scripts/reading.js
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,14 @@ function goToChapterProgress(chapterIndex, chapterProgress, animation = true)
}

if(closest.page)
reading.goToIndex(closest.page.index + 1, animation);
{
let index = closest.page.index + 1;

if(_config.readingManga && !readingViewIs('scroll'))
index = (indexNum - closest.page.index);

reading.goToIndex(index, animation);
}
}

//Go to the next comic page
Expand Down Expand Up @@ -3193,7 +3200,7 @@ function loadBookmarks(bookmarksChild = false)
continueReading: false,
current: (path === readingCurrentPath) ? true : false,
path: path,
name: p.basename(path),
name: dom.metadataPathName({path: path, name: p.basename(path)}, true),
bookmarks: bookmarksPath[path],
});
}
Expand All @@ -3218,6 +3225,10 @@ function loadBookmarks(bookmarksChild = false)
sha: sha,
mainPath: readingProgress.mainPath,
path: readingProgress.path,
ebook: readingProgress.ebook,
progress: readingProgress.progress,
chapterIndex: readingProgress.chapterIndex,
chapterProgress: readingProgress.chapterProgress,
}],
});
}
Expand Down
4 changes: 2 additions & 2 deletions templates/reading.content.left.ebook.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div class="reading-toc-items">
{{#each ebookToc}}
<div class="reading-toc-item reading-toc-page-{{page}}">
<div class="reading-toc-title label-medium" onclick="reading.goToIndex({{page}})">
<div class="reading-toc-title label-medium" onclick="reading.goToPage({{page}})">
{{#if image}}<img class="ri-sha-{{image.sha}}" src="{{chain 'escapeBackSlash' 'escapeQuotesSimples' image.thumbnail}}">{{/if}}
<div>{{name}}</div>
</div>
Expand All @@ -16,7 +16,7 @@
</div>
{{/if}}
{{#each pages}}
<div class="reading-toc-page label-large" onclick="reading.goToIndex({{page}})">{{name}}</div>
<div class="reading-toc-page label-large" onclick="reading.goToPage({{page}})">{{name}}</div>
{{/each}}
</div>
{{/each}}
Expand Down

0 comments on commit a901754

Please sign in to comment.