Hey folks, sorry if this has been answered earlier. First time using Sage - LOVING it!
Have a header that is different on front page than rest of site. All headers use a very similar bit of js to shrink on scroll, but the front page is a wee bit different.
In the common.js I would like to include an if statement based on if currently on home page or not. Not sure how to go about it. Any help would be appreciated.
I would go similar way as the idea behind JS routing used in Sage9 - so I would try to match the css class added to the <body> tag.
Alternatively you can add specific class to the header if is_home() returns true (I believe that this might be a better method in many scenarios).
So anything like (that is a very simplified example, I would solve final code in more elegant way)
Props for using ES6 instead of jQuery. We have 2019 and I still do not know if I should advice people in ES6 or “old jQuery way” as many people still have issues with that.