mirror of
https://github.com/pinry/pinry.git
synced 2025-11-17 18:30:39 +01:00
Refactor: Make getDocumentScrollTop a standalone function
This commit is contained in:
committed by
Isaac Bythewood
parent
b155f806bc
commit
897d80170f
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user