Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

angular2-infinite-scroll

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular2-infinite-scroll - npm Package Compare versions

Comparing version 0.2.5 to 0.2.6-0

21

bundles/angular2-infinite-scroll.js

@@ -1,2 +0,2 @@

System.registerDynamic('src/scroller', ['rxjs/Observable', 'rxjs/add/observable/fromEvent', 'rxjs/add/observable/timer', 'rxjs/add/operator/throttle', 'rxjs/add/operator/filter'], true, function ($__require, exports, module) {
System.registerDynamic('src/scroller', ['rxjs/Observable', 'rxjs/add/observable/fromEvent', 'rxjs/add/observable/timer', 'rxjs/add/operator/throttle', 'rxjs/add/operator/filter', 'rxjs/add/operator/delay'], true, function ($__require, exports, module) {
"use strict";

@@ -12,4 +12,5 @@

$__require('rxjs/add/operator/filter');
$__require('rxjs/add/operator/delay');
;
var Scroller = function () {
// private axis: AxisResolver;
function Scroller(windowElement, $interval, $elementRef, infiniteScrollDownCallback, infiniteScrollUpCallback, infiniteScrollDownDistance, infiniteScrollUpDistance, infiniteScrollParent, infiniteScrollThrottle, isImmediate, horizontal, alwaysCallback, scrollDisabled, positionResolver) {

@@ -90,6 +91,9 @@ if (horizontal === void 0) {

if (triggerCallback) {
var infiniteScrollEvent = {
currentScrollPosition: container.scrolledUntilNow
};
if (scrollingDown) {
this.infiniteScrollDownCallback({ currentScrollPosition: container.scrolledUntilNow });
this.infiniteScrollDownCallback(infiniteScrollEvent);
} else {
this.infiniteScrollUpCallback({ currentScrollPosition: container.scrolledUntilNow });
this.infiniteScrollUpCallback(infiniteScrollEvent);
}

@@ -115,3 +119,10 @@ }

}).subscribe(function (ev) {
return _this.handler();
_this.handler();
setTimeout(function () {
var container = _this.positionResolver.calculatePoints(_this.$elementRef);
var reachedEndOfContainer = container.scrolledUntilNow >= container.totalToScroll;
if (reachedEndOfContainer) {
_this.handler();
}
}, 100);
});

@@ -118,0 +129,0 @@ }

{
"name": "angular2-infinite-scroll",
"version": "0.2.5",
"version": "0.2.6-0",
"description": "An infinite scroll directive for angular2",

@@ -5,0 +5,0 @@ "main": "angular2-infinite-scroll.js",

@@ -7,2 +7,6 @@ import { ElementRef } from '@angular/core';

import 'rxjs/add/operator/filter';
import 'rxjs/add/operator/delay';
export interface InfiniteScrollEvent {
currentScrollPosition: number;
}
export declare class Scroller {

@@ -32,2 +36,3 @@ private windowElement;

lastScrollPosition: number;
private _timeout;
constructor(windowElement: Window | ElementRef | any, $interval: Function, $elementRef: ElementRef, infiniteScrollDownCallback: Function, infiniteScrollUpCallback: Function, infiniteScrollDownDistance: number, infiniteScrollUpDistance: number, infiniteScrollParent: Window | ElementRef | any, infiniteScrollThrottle: number, isImmediate: boolean, horizontal: boolean, alwaysCallback: boolean, scrollDisabled: boolean, positionResolver: PositionResolver);

@@ -34,0 +39,0 @@ defineContainer(): void;

@@ -7,4 +7,5 @@ "use strict";

require('rxjs/add/operator/filter');
require('rxjs/add/operator/delay');
;
var Scroller = (function () {
// private axis: AxisResolver;
function Scroller(windowElement, $interval, $elementRef, infiniteScrollDownCallback, infiniteScrollUpCallback, infiniteScrollDownDistance, infiniteScrollUpDistance, infiniteScrollParent, infiniteScrollThrottle, isImmediate, horizontal, alwaysCallback, scrollDisabled, positionResolver) {

@@ -81,7 +82,10 @@ if (horizontal === void 0) { horizontal = false; }

if (triggerCallback) {
var infiniteScrollEvent = {
currentScrollPosition: container.scrolledUntilNow
};
if (scrollingDown) {
this.infiniteScrollDownCallback({ currentScrollPosition: container.scrolledUntilNow });
this.infiniteScrollDownCallback(infiniteScrollEvent);
}
else {
this.infiniteScrollUpCallback({ currentScrollPosition: container.scrolledUntilNow });
this.infiniteScrollUpCallback(infiniteScrollEvent);
}

@@ -105,3 +109,12 @@ }

.filter(function (ev) { return _this.scrollEnabled; })
.subscribe(function (ev) { return _this.handler(); });
.subscribe(function (ev) {
_this.handler();
setTimeout(function () {
var container = _this.positionResolver.calculatePoints(_this.$elementRef);
var reachedEndOfContainer = container.scrolledUntilNow >= container.totalToScroll;
if (reachedEndOfContainer) {
_this.handler();
}
}, 100);
});
}

@@ -120,2 +133,2 @@ };

exports.Scroller = Scroller;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2Nyb2xsZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJzY3JvbGxlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQ0EsMkJBQTJCLGlCQUFpQixDQUFDLENBQUE7QUFJN0MsUUFBTywrQkFBK0IsQ0FBQyxDQUFBO0FBQ3ZDLFFBQU8sMkJBQTJCLENBQUMsQ0FBQTtBQUNuQyxRQUFPLDRCQUE0QixDQUFDLENBQUE7QUFDcEMsUUFBTywwQkFBMEIsQ0FBQyxDQUFBO0FBRWxDO0lBYUUsOEJBQThCO0lBRTlCLGtCQUNVLGFBQXdDLEVBQ3hDLFNBQW1CLEVBQ25CLFdBQXVCLEVBQ3ZCLDBCQUFvQyxFQUNwQyx3QkFBa0MsRUFDMUMsMEJBQWtDLEVBQ2xDLHdCQUFnQyxFQUNoQyxvQkFBK0MsRUFDdkMsc0JBQThCLEVBQzlCLFdBQW9CLEVBQ3BCLFVBQTJCLEVBQzNCLGNBQStCLEVBQy9CLGNBQStCLEVBQy9CLGdCQUFrQztRQUgxQywwQkFBbUMsR0FBbkMsa0JBQW1DO1FBQ25DLDhCQUF1QyxHQUF2QyxzQkFBdUM7UUFDdkMsOEJBQXVDLEdBQXZDLHNCQUF1QztRQVovQixrQkFBYSxHQUFiLGFBQWEsQ0FBMkI7UUFDeEMsY0FBUyxHQUFULFNBQVMsQ0FBVTtRQUNuQixnQkFBVyxHQUFYLFdBQVcsQ0FBWTtRQUN2QiwrQkFBMEIsR0FBMUIsMEJBQTBCLENBQVU7UUFDcEMsNkJBQXdCLEdBQXhCLHdCQUF3QixDQUF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2Nyb2xsRW5hYmxlZCA9ICFzY3JvbGxEaXNhYmxlZDtcbiAgfVxufVxuXG5pbnRlcmZhY2UgRGVjb3JhdG9ySW52b2NhdGlvbiB7XG4gIHR5cGU6IEZ1bmN0aW9uO1xuICBhcmdzPzogYW55W107XG59XG4iXX0=
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc