aboutsummaryrefslogtreecommitdiff
path: root/public/js/app.js
diff options
context:
space:
mode:
authorThedro Neely <thedroneely@gmail.com>2019-11-09 03:20:39 -0500
committerThedro Neely <thedroneely@gmail.com>2019-11-09 03:20:39 -0500
commite18bd1d376dfe8c2df58b0b13ac173e2b73097df (patch)
treefd767f3526ba8b1a91c377469a4359b8a7ceb3ca /public/js/app.js
parentc5255a0249489f44c83a95cd57b5643b8e03f31e (diff)
downloadthedroneely.com-e18bd1d376dfe8c2df58b0b13ac173e2b73097df.tar.gz
thedroneely.com-e18bd1d376dfe8c2df58b0b13ac173e2b73097df.tar.bz2
thedroneely.com-e18bd1d376dfe8c2df58b0b13ac173e2b73097df.zip
public/js/app: Replace arrow functions
Diffstat (limited to 'public/js/app.js')
-rw-r--r--public/js/app.js15
1 files changed, 7 insertions, 8 deletions
diff --git a/public/js/app.js b/public/js/app.js
index ddfdc3e..11c4283 100644
--- a/public/js/app.js
+++ b/public/js/app.js
@@ -613,7 +613,6 @@ imageZoom.on('close', function(event) { remClass(navbar, 'navbar__headroom'); })
/**
* instant.page v3.0.0 - (C) 2019 Alexandre Dieulot - https://instant.page/license
*/
-
let mouseoverTimer
let lastTouchTimestamp
const prefetches = new Set()
@@ -680,21 +679,21 @@ if (isSupported) {
if (useViewport) {
let triggeringFunction
if (window.requestIdleCallback) {
- triggeringFunction = (callback) => {
+ triggeringFunction = function(callback) {
requestIdleCallback(callback, {
timeout: 1500,
})
}
}
else {
- triggeringFunction = (callback) => {
+ triggeringFunction = function(callback) {
callback()
}
}
- triggeringFunction(() => {
- const intersectionObserver = new IntersectionObserver((entries) => {
- entries.forEach((entry) => {
+ triggeringFunction(function() {
+ const intersectionObserver = new IntersectionObserver(function(entries) {
+ entries.forEach(function(entry) {
if (entry.isIntersecting) {
const linkElement = entry.target
intersectionObserver.unobserve(linkElement)
@@ -703,7 +702,7 @@ if (isSupported) {
})
})
- document.querySelectorAll('a').forEach((linkElement) => {
+ document.querySelectorAll('a').forEach(function(linkElement) {
if (isPreloadable(linkElement)) {
intersectionObserver.observe(linkElement)
}
@@ -739,7 +738,7 @@ function mouseoverListener(event) {
linkElement.addEventListener('mouseout', mouseoutListener, {passive: true})
- mouseoverTimer = setTimeout(() => {
+ mouseoverTimer = setTimeout(function() {
preload(linkElement.href)
mouseoverTimer = undefined
}, delayOnHover)