seng-scroll-tracker
Version:
Class that keeps track of the vertical scroll position of an element.
28 lines (27 loc) • 960 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var seng_event_1 = require("seng-event");
/**
* Events to thrown by ScrollTracker and ScrollTrackerPoint instances
*/
var ScrollTrackerEvent = /** @class */ (function (_super) {
tslib_1.__extends(ScrollTrackerEvent, _super);
function ScrollTrackerEvent(type, point, side) {
var _this = _super.call(this, type) || this;
_this.point = point;
_this.side = side;
return _this;
}
ScrollTrackerEvent.prototype.clone = function () {
return new ScrollTrackerEvent(this.type, this.point, this.side);
};
ScrollTrackerEvent.types = {
ENTER_VIEW: 'ENTER_VIEW',
LEAVE_VIEW: 'LEAVE_VIEW',
BOUNDS_CHANGED: 'BOUNDS_CHANGED',
SCROLLED_BEYOND: 'SCROLLED_BEYOND',
};
return ScrollTrackerEvent;
}(seng_event_1.AbstractEvent));
exports.default = ScrollTrackerEvent;