Sfoglia il codice sorgente

Refactor: Make getDocumentScrollTop a standalone function

pull/169/head
winkidney 5 anni fa
committed by Isaac Bythewood
parent
commit
897d80170f
2 ha cambiato i file con 5 aggiunte e 5 eliminazioni
  1. +5
    -0
      pinry/static/js/helpers.js
  2. +0
    -5
      pinry/static/js/vue/main.js

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


Caricamento…
Annulla
Salva