Skip to content
This repository has been archived by the owner on Nov 12, 2019. It is now read-only.

Commit

Permalink
Merge pull request #62 from yjlintw/fixed-title-dm5
Browse files Browse the repository at this point in the history
fixed chapter selector scrolling, and dm5 wrong parsing
  • Loading branch information
yjlintw authored Apr 24, 2017
2 parents 7cdfd0a + c2b057f commit 8df9427
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ body, html, .whole-view {
top: 50px; } }
@media only screen and (min-width: 769px) {
#read-view .middle-panel {
height: 100vh;
height: calc(100vh - 22px);
width: 250px;
position: fixed;
overflow-y: auto;
Expand Down
2 changes: 1 addition & 1 deletion assets/scss/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ body {

}
@media #{$info-tablet} {
height: 100vh;
height: calc(100vh - #{$titlebar-height};
width: $chapter-selector-width;
position: fixed;
overflow-y: auto;
Expand Down
5 changes: 3 additions & 2 deletions renderer-process/parsers/dm5.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ function onChapterGrabbed(error, response, body) {
if($(e).attr('href') == undefined) return;
var ch_name = $(e).text();
var rel_link = $(e).attr('href');
if (rel_link.includes("javascript")) return;
var ch_link = baseuri + rel_link;
var ch_group = "cr_main";
// var link_chunks = $(e).find('a').attr('href').split('/');
Expand Down Expand Up @@ -189,8 +190,8 @@ function onChapterGrabbed(error, response, body) {
// for(var i = 0; i < result.length; i++) {
// result[i].index = i;
// }
console.log(this.titlekey)
console.log(result);
// console.log(this.titlekey)
// console.log(result);
newest = result[0].ch_name;

this.callback(result, newest);
Expand Down
12 changes: 6 additions & 6 deletions renderer-process/viewcontrollers/read-viewcontroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ function prevPic() {

if ($("#" + page_id_list[current_page_idx]).offset() !== undefined ) {
$('html, body').animate({
scrollTop: $("#" + page_id_list[current_page_idx]).offset().top - 22
scrollTop: $("#" + page_id_list[current_page_idx]).offset().top - $("#titlebar").outerHeight()
}, 100);
}
}
Expand All @@ -200,7 +200,7 @@ function nextPic() {
if (current_page_idx >= page_id_list.length) current_page_idx = page_id_list.length -1;
if ($("#" + page_id_list[current_page_idx]).offset() !== undefined) {
$('html, body').animate({
scrollTop: $("#" + page_id_list[current_page_idx]).offset().top - 22
scrollTop: $("#" + page_id_list[current_page_idx]).offset().top - $("#titlebar").outerHeight()
}, 100)
}
}
Expand Down Expand Up @@ -249,15 +249,15 @@ function scrollToPage(page_idx) {
* will always be visible
*/
function scrollMiddlePanel() {
var scroll_bottom = $(".middle-panel").height() - $("#comic-header").height();
var scroll_bottom = $(".middle-panel").height() - $("#comic-header").height() + $("#titlebar").outerHeight();
var e = $(chapter_list[current_chapter_idx]);
if (e.offset() && e.offset().top + e.height() >= scroll_bottom) {
$(".middle-panel").animate({
scrollTop: $(".middle-panel").scrollTop() + e.offset().top - $("#comic-header").outerHeight()
scrollTop: $(".middle-panel").scrollTop() + e.offset().top - $("#comic-header").outerHeight() - $("#titlebar").outerHeight()
}, 100)
} else if (e.offset() && e.offset().top < $("#comic-header").outerHeight()) {
} else if (e.offset() && e.offset().top < $("#comic-header").outerHeight() + $("#titlebar").outerHeight()) {
$(".middle-panel").animate({
scrollTop: $(".middle-panel").scrollTop() - $(".middle-panel").height() + $("#comic-header").outerHeight() + e.offset().top
scrollTop: $(".middle-panel").scrollTop() - $(".middle-panel").height() + $("#comic-header").outerHeight() + e.offset().top - $("#titlebar").outerHeight()
}, 100)
}
}
Expand Down

0 comments on commit 8df9427

Please sign in to comment.