Browse Source

Refactor: Make getDocumentScrollTop a standalone function

pull/169/head
winkidney 5 years ago
committed by Isaac Bythewood
parent
commit
897d80170f
2 changed files with 5 additions and 5 deletions
  1. +5
    -0
      pinry/static/js/helpers.js
  2. +0
    -5
      pinry/static/js/vue/main.js

+ 5
- 0
pinry/static/js/helpers.js 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);
}

+ 0
- 5
pinry/static/js/vue/main.js 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


Loading…
Cancel
Save