瀏覽代碼

Refactor: Make getDocumentScrollTop a standalone function

pull/169/head
winkidney 5 年之前
committed by Isaac Bythewood
父節點
當前提交
897d80170f
共有 2 個文件被更改,包括 5 次插入5 次删除
  1. +5
    -0
      pinry/static/js/helpers.js
  2. +0
    -5
      pinry/static/js/vue/main.js

+ 5
- 0
pinry/static/js/helpers.js 查看文件

@@ -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 查看文件

@@ -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…
取消
儲存