-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kinda infinite-scrolling #15
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
var currentURL=''; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The variable you created is not used, so you can remove it too :) |
||
// Modules | ||
const shell = require('electron').shell, | ||
remote = require('electron').remote, | ||
|
@@ -469,6 +470,7 @@ function getResults(url) | |
return; | ||
} | ||
}) | ||
currentURL = url; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What did you want to do here ? |
||
} | ||
|
||
/** | ||
|
@@ -511,6 +513,7 @@ function emptyContainer() | |
while (container.firstChild) | ||
{ | ||
container.removeChild(container.firstChild); | ||
pid = 1; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What I was trying to do was that, if you use infinite-scrolling lets say you end up on page 10 then when you select the Top section in the lateral navbar the page won't restart the pagination. |
||
} | ||
} | ||
|
||
|
@@ -553,4 +556,17 @@ function isTagInSearchBar(tag) | |
{ | ||
return false; | ||
} | ||
} | ||
} | ||
|
||
$(document).ready(function(){ | ||
$(window).scroll(function () { | ||
if ($(window).scrollTop() >= $(document).height() - $(window).height() - 0.1) { | ||
showLoading(); | ||
hideLoading(); | ||
let url = getUrl(tags, imgLimit, rating); | ||
getResults(url + `&pid=${pid}`); | ||
pid++; | ||
displayPid.innerHTML = `Page ${pid}`; | ||
} | ||
}) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove this too