mirror of
https://github.com/pinry/pinry.git
synced 2025-11-18 02:40:40 +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) {
|
function getUrlParameter(name) {
|
||||||
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search) || [, ""])[1].replace(/\+/g, '%20')) || null;
|
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 () {
|
bindScrollHandler: function () {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
function getDocumentScrollTop() {
|
|
||||||
var doc = document.documentElement;
|
|
||||||
return (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
scrollHandler = function() {
|
scrollHandler = function() {
|
||||||
if (self.status.loading || !self.status.hasNext) {
|
if (self.status.loading || !self.status.hasNext) {
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user