diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2019-04-19 00:50:45 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2019-04-19 00:50:45 +0200 |
| commit | 9515fc2e473e3fc51fbf26b77d3f49122808ce1b (patch) | |
| tree | 9d8f382bae76855e7868abe74d35cfe50f33edc8 /client/index.js | |
| parent | 03dae85958c9f4c4a41c9c5534cd54ccc1d04c5f (diff) | |
filter map by type
Diffstat (limited to 'client/index.js')
| -rw-r--r-- | client/index.js | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/client/index.js b/client/index.js index c003a8b3..1a80e74f 100644 --- a/client/index.js +++ b/client/index.js @@ -2,7 +2,7 @@ import React from 'react' import ReactDOM from 'react-dom' import { AppContainer } from 'react-hot-loader' import { Provider } from 'react-redux' -import 'waypoints/lib/noframework.waypoints.min.js'; +import 'waypoints/lib/noframework.waypoints.min.js' import { toArray } from './util' import Applet from './applet' @@ -62,7 +62,7 @@ function runApplets() { let payload try { payload = JSON.parse(el.dataset.payload) - console.log(payload) + // console.log(payload) } catch (e) { return null } @@ -106,7 +106,7 @@ function runApplets() { } payload.dataset = dataset payload.url = url - console.log(payload) + // console.log(payload) return [el, payload] }).filter(a => !!a) const withDataset = applets.map(a => a[1].dataset ? a[1] : null).filter(a => !!a) @@ -122,20 +122,20 @@ function runApplets() { function buildWaypoints() { const element = document.querySelector('.content section:nth-child(2)') - if (element) { - var waypoint = new Waypoint({ - element, - handler: function(direction) { - if (direction === 'down') { - document.body.classList.add('scrolled') - } else { - document.body.classList.remove('scrolled') - } - // console.log(direction) - // console.log('Scrolled to waypoint!') + if (!element) return null + let waypoint = new Waypoint({ + element, + handler: function(direction) { + if (direction === 'down') { + document.body.classList.add('scrolled') + } else { + document.body.classList.remove('scrolled') } - }) - } + // console.log(direction) + // console.log('Scrolled to waypoint!') + } + }) + return waypoint } function main() { |
