Created
May 24, 2017 16:41
-
-
Save haknick/84c40df21fda6eeb0f7a86371675c178 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const sections = data.triggerPoints; | |
const seo = data.seo; | |
//const activeSection = []; | |
t = scrollTop+ headerOffset; | |
if (t < sections[0][1]) | |
return R.find((_seo) => $('body').hasClass(_seo.id), seo); | |
var hasSEO = (_id) => R.find((_seo) =>_seo.id==_id, seo) != undefined; | |
const sectionAfterT = R.filter((_section) => (t <= _section[1]), sections); | |
const firstMatchTriggerPoint = R.find((_section) => hasSEO(_section[0]), sectionAfterT); | |
return R.find((_seo)=>_seo.id==firstMatchTriggerPoint[0], seo) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment