|
@ -228,7 +228,13 @@ |
|
|
const elements = this.$$('.' + this.state.namespace + '__inner a'); |
|
|
const elements = this.$$('.' + this.state.namespace + '__inner a'); |
|
|
|
|
|
|
|
|
// @TODO check offset |
|
|
// @TODO check offset |
|
|
const offset = this.state.options.offset - 25; |
|
|
|
|
|
|
|
|
let offset = 25; |
|
|
|
|
|
|
|
|
|
|
|
if (typeof this.state.options.offset === "function") { |
|
|
|
|
|
offset = this.state.options.offset() - offset; |
|
|
|
|
|
} else { |
|
|
|
|
|
offset = this.state.options.offset - offset; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// if found |
|
|
// if found |
|
|
let hasFound = false; |
|
|
let hasFound = false; |
|
@ -237,9 +243,9 @@ |
|
|
let result = undefined; |
|
|
let result = undefined; |
|
|
|
|
|
|
|
|
if (window.pageYOffset > offset) { |
|
|
if (window.pageYOffset > offset) { |
|
|
document.querySelector('body').classList.add('is-scrolling'); |
|
|
|
|
|
|
|
|
document.querySelector('body').classList.add('has-scrolled'); |
|
|
} else { |
|
|
} else { |
|
|
document.querySelector('body').classList.remove('is-scrolling'); |
|
|
|
|
|
|
|
|
document.querySelector('body').classList.remove('has-scrolled'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
elements.forEach(function(element, index) { |
|
|
elements.forEach(function(element, index) { |
|
|