Refactor: Make getDocumentScrollTop a standalone function

This commit is contained in:
winkidney
2019-03-20 18:26:07 +08:00
committed by Isaac Bythewood
parent b155f806bc
commit 897d80170f
2 changed files with 5 additions and 5 deletions

View File

@@ -81,3 +81,8 @@ function postPinData(data) {
function getUrlParameter(name) {
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search) || [, ""])[1].replace(/\+/g, '%20')) || null;
}
function getDocumentScrollTop() {
var doc = document.documentElement;
return (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0);
}

View File

@@ -348,11 +348,6 @@ Vue.component('pin-container', {
bindScrollHandler: function () {
var self = this;
function getDocumentScrollTop() {
var doc = document.documentElement;
return (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0);
}
scrollHandler = function() {
if (self.status.loading || !self.status.hasNext) {
return