mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 01:41:46 +03:00
5c9a824d53
no issue - drops the `var Foo = Ember.Thing.extend({}); export default Foo;` syntax in favour of exporting directly, eg: `export default Ember.Thing.extend({})` - discussion on this change [here](https://github.com/TryGhost/Ghost/pull/5340#issuecomment-105828423) and [here](https://github.com/TryGhost/Ghost/pull/5694#discussion-diff-37511606)
18 lines
666 B
JavaScript
18 lines
666 B
JavaScript
// ## scrollShadow
|
|
// This adds a 'scroll' class to the targeted element when the element is scrolled
|
|
// `this` is expected to be a jQuery-wrapped element
|
|
// **target:** The element in which the class is applied. Defaults to scrolled element.
|
|
// **class-name:** The class which is applied.
|
|
// **offset:** How far the user has to scroll before the class is applied.
|
|
export default function (options) {
|
|
var $target = options.target || this,
|
|
offset = options.offset,
|
|
className = options.className || 'scrolling';
|
|
|
|
if (this.scrollTop() > offset) {
|
|
$target.addClass(className);
|
|
} else {
|
|
$target.removeClass(className);
|
|
}
|
|
}
|