ngx-infinite-scroll
Advanced tools
Comparing version 0.5.2-0 to 0.5.2
@@ -39,3 +39,3 @@ (function (global, factory) { | ||
PositionResolver.prototype.isElementWindow = function (windowElement) { | ||
var /** @type {?} */ isWindow = Object.prototype.toString.call(windowElement).includes('Window'); | ||
var /** @type {?} */ isWindow = ['Window', 'global'].some(function (obj) { return Object.prototype.toString.call(windowElement).includes(obj); }); | ||
return isWindow; | ||
@@ -42,0 +42,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?factory(exports,require("@angular/core"),require("rxjs/Observable"),require("rxjs/add/observable/fromEvent"),require("rxjs/add/observable/of"),require("rxjs/add/operator/sampleTime"),require("rxjs/add/operator/filter"),require("rxjs/add/operator/mergeMap")):"function"==typeof define&&define.amd?define(["exports","@angular/core","rxjs/Observable","rxjs/add/observable/fromEvent","rxjs/add/observable/of","rxjs/add/operator/sampleTime","rxjs/add/operator/filter","rxjs/add/operator/mergeMap"],factory):factory((global.ng=global.ng||{},global.ng.ngxInfiniteScroll=global.ng.ngxInfiniteScroll||{}),global.ng.core,global.Rx)}(this,function(exports,_angular_core,rxjs_Observable){"use strict";function resolveContainerElement(selector,scrollWindow,defaultElement){var hasWindow=window&&window.hasOwnProperty("document"),containerIsString=selector&&hasWindow&&"string"==typeof selector,container=containerIsString?window.document.querySelector(selector):selector;return selector||(container=scrollWindow?window:defaultElement),container}var PositionResolver=function(){function PositionResolver(){}return PositionResolver.prototype.create=function(options){var isWindow=this.isElementWindow(options.windowElement);return{axis:options.axis,container:this.defineContainer(options.windowElement,isWindow),isWindow:isWindow}},PositionResolver.prototype.defineContainer=function(windowElement,isContainerWindow){return isContainerWindow||!windowElement.nativeElement?windowElement:windowElement.nativeElement},PositionResolver.prototype.isElementWindow=function(windowElement){return Object.prototype.toString.call(windowElement).includes("Window")},PositionResolver.prototype.getDocumentElement=function(isContainerWindow,windowElement){return isContainerWindow?windowElement.document.documentElement:null},PositionResolver.prototype.calculatePoints=function(element,resolver){return resolver.isWindow?this.calculatePointsForWindow(element,resolver):this.calculatePointsForElement(element,resolver)},PositionResolver.prototype.calculatePointsForWindow=function(element,resolver){var axis=resolver.axis,container=resolver.container,isWindow=resolver.isWindow,offsetHeightKey=axis.offsetHeightKey(),clientHeightKey=axis.clientHeightKey(),height=(axis.topKey(),this.height(container,isWindow,offsetHeightKey,clientHeightKey)),scrolledUntilNow=height+this.pageYOffset(this.getDocumentElement(isWindow,container),axis,isWindow),nativeElementHeight=this.height(element.nativeElement,isWindow,offsetHeightKey,clientHeightKey);return{height:height,scrolledUntilNow:scrolledUntilNow,totalToScroll:this.offsetTop(element.nativeElement,axis,isWindow)+nativeElementHeight}},PositionResolver.prototype.calculatePointsForElement=function(element,resolver){var axis=resolver.axis,container=resolver.container,isWindow=resolver.isWindow,offsetHeightKey=axis.offsetHeightKey(),clientHeightKey=axis.clientHeightKey(),scrollTop=axis.scrollTopKey(),scrollHeight=axis.scrollHeightKey(),height=(axis.topKey(),this.height(container,isWindow,offsetHeightKey,clientHeightKey)),scrolledUntilNow=container[scrollTop],offsetTop=this.offsetTop(container,axis,isWindow);return void 0!==offsetTop&&offsetTop,{height:height,scrolledUntilNow:scrolledUntilNow,totalToScroll:container[scrollHeight]}},PositionResolver.prototype.height=function(elem,isWindow,offsetHeightKey,clientHeightKey){return isNaN(elem[offsetHeightKey])?this.getDocumentElement(isWindow,elem)[clientHeightKey]:elem[offsetHeightKey]},PositionResolver.prototype.offsetTop=function(elem,axis,isWindow){var topKey=axis.topKey();if(elem.getBoundingClientRect)return elem.getBoundingClientRect()[topKey]+this.pageYOffset(elem,axis,isWindow)},PositionResolver.prototype.pageYOffset=function(elem,axis,isWindow){var pageYOffset=axis.pageYOffsetKey(),scrollTop=axis.scrollTopKey(),offsetTop=axis.offsetTopKey();return isNaN(window[pageYOffset])?this.getDocumentElement(isWindow,elem)[scrollTop]:elem.ownerDocument?elem.ownerDocument.defaultView[pageYOffset]:elem[offsetTop]},PositionResolver}();PositionResolver.decorators=[{type:_angular_core.Injectable}],PositionResolver.ctorParameters=function(){return[]};var ScrollRegister=function(){function ScrollRegister(){}return ScrollRegister.prototype.attachEvent=function(options){return rxjs_Observable.Observable.fromEvent(options.container,"scroll").sampleTime(options.throttleDuration).filter(options.filterBefore).mergeMap(function(ev){return rxjs_Observable.Observable.of(options.mergeMap(ev))}).subscribe(options.scrollHandler)},ScrollRegister}();ScrollRegister.decorators=[{type:_angular_core.Injectable}],ScrollRegister.ctorParameters=function(){return[]};var ScrollResolver=function(){function ScrollResolver(){this.lastScrollPosition=0}return ScrollResolver.prototype.shouldScroll=function(container,config,scrollingDown){var remaining,containerBreakpoint,distance=config.distance;scrollingDown?(remaining=container.totalToScroll-container.scrolledUntilNow,containerBreakpoint=container.height*distance.down+1):(remaining=container.scrolledUntilNow,containerBreakpoint=container.height*distance.up+1);var shouldScroll=remaining<=containerBreakpoint;return this.lastScrollPosition=container.scrolledUntilNow,shouldScroll},ScrollResolver.prototype.isScrollingDown=function(container){return this.lastScrollPosition<container.scrolledUntilNow},ScrollResolver.prototype.getScrollStats=function(container,config){var isScrollingDown=this.isScrollingDown(container);return{isScrollingDown:isScrollingDown,shouldScroll:this.shouldScroll(container,config,isScrollingDown)}},ScrollResolver}();ScrollResolver.decorators=[{type:_angular_core.Injectable}],ScrollResolver.ctorParameters=function(){return[]};var AxisResolver=function(){function AxisResolver(vertical){void 0===vertical&&(vertical=!0),this.vertical=vertical}return AxisResolver.prototype.clientHeightKey=function(){return this.vertical?"clientHeight":"clientWidth"},AxisResolver.prototype.offsetHeightKey=function(){return this.vertical?"offsetHeight":"offsetWidth"},AxisResolver.prototype.scrollHeightKey=function(){return this.vertical?"scrollHeight":"scrollWidth"},AxisResolver.prototype.pageYOffsetKey=function(){return this.vertical?"pageYOffset":"pageXOffset"},AxisResolver.prototype.offsetTopKey=function(){return this.vertical?"offsetTop":"offsetLeft"},AxisResolver.prototype.scrollTopKey=function(){return this.vertical?"scrollTop":"scrollLeft"},AxisResolver.prototype.topKey=function(){return this.vertical?"top":"left"},AxisResolver}(),InfiniteScrollDirective=function(){function InfiniteScrollDirective(element,zone,positionResolver,scrollRegister,scrollerResolver){this.element=element,this.zone=zone,this.positionResolver=positionResolver,this.scrollRegister=scrollRegister,this.scrollerResolver=scrollerResolver,this.scrolled=new _angular_core.EventEmitter,this.scrolledUp=new _angular_core.EventEmitter,this.infiniteScrollDistance=2,this.infiniteScrollUpDistance=1.5,this.infiniteScrollThrottle=300,this.infiniteScrollDisabled=!1,this.infiniteScrollContainer=null,this.scrollWindow=!0,this.immediateCheck=!1,this.horizontal=!1,this.alwaysCallback=!1}return InfiniteScrollDirective.prototype.ngOnInit=function(){this.setup()},InfiniteScrollDirective.prototype.ngOnChanges=function(_a){var infiniteScrollContainer=_a.infiniteScrollContainer;infiniteScrollContainer&&!infiniteScrollContainer.firstChange&&(this.destroyScroller(),this.setup())},InfiniteScrollDirective.prototype.setup=function(){var _this=this;"undefined"!=typeof window&&this.zone.runOutsideAngular(function(){var containerElement=resolveContainerElement(_this.infiniteScrollContainer,_this.scrollWindow,_this.element),resolver=_this.positionResolver.create({axis:new AxisResolver(!_this.horizontal),windowElement:containerElement}),options={container:resolver.container,filterBefore:function(){return!_this.infiniteScrollDisabled},mergeMap:function(){return _this.positionResolver.calculatePoints(_this.element,resolver)},scrollHandler:function(container){return _this.handleOnScroll(container)},throttleDuration:_this.infiniteScrollThrottle};_this.disposeScroller=_this.scrollRegister.attachEvent(options)})},InfiniteScrollDirective.prototype.handleOnScroll=function(container){var distance={down:this.infiniteScrollDistance,up:this.infiniteScrollUpDistance},scrollStats=this.scrollerResolver.getScrollStats(container,{distance:distance});if(this.shouldTriggerEvents(scrollStats.shouldScroll)){var infiniteScrollEvent={currentScrollPosition:container.scrolledUntilNow};scrollStats.isScrollingDown?this.onScrollDown(infiniteScrollEvent):this.onScrollUp(infiniteScrollEvent)}},InfiniteScrollDirective.prototype.shouldTriggerEvents=function(shouldScroll){return(this.alwaysCallback||shouldScroll)&&!this.infiniteScrollDisabled},InfiniteScrollDirective.prototype.ngOnDestroy=function(){this.destroyScroller()},InfiniteScrollDirective.prototype.onScrollDown=function(data){var _this=this;void 0===data&&(data={currentScrollPosition:0}),this.zone.run(function(){return _this.scrolled.emit(data)})},InfiniteScrollDirective.prototype.onScrollUp=function(data){var _this=this;void 0===data&&(data={currentScrollPosition:0}),this.zone.run(function(){return _this.scrolledUp.emit(data)})},InfiniteScrollDirective.prototype.destroyScroller=function(){this.disposeScroller&&this.disposeScroller.unsubscribe()},InfiniteScrollDirective}();InfiniteScrollDirective.decorators=[{type:_angular_core.Directive,args:[{providers:[ScrollResolver],selector:"[infiniteScroll], [infinite-scroll], [data-infinite-scroll]"}]}],InfiniteScrollDirective.ctorParameters=function(){return[{type:_angular_core.ElementRef},{type:_angular_core.NgZone},{type:PositionResolver},{type:ScrollRegister},{type:ScrollResolver}]},InfiniteScrollDirective.propDecorators={scrolled:[{type:_angular_core.Output}],scrolledUp:[{type:_angular_core.Output}],infiniteScrollDistance:[{type:_angular_core.Input}],infiniteScrollUpDistance:[{type:_angular_core.Input}],infiniteScrollThrottle:[{type:_angular_core.Input}],infiniteScrollDisabled:[{type:_angular_core.Input}],infiniteScrollContainer:[{type:_angular_core.Input}],scrollWindow:[{type:_angular_core.Input}],immediateCheck:[{type:_angular_core.Input}],horizontal:[{type:_angular_core.Input}],alwaysCallback:[{type:_angular_core.Input}]};var InfiniteScrollModule=function(){function InfiniteScrollModule(){}return InfiniteScrollModule}();InfiniteScrollModule.decorators=[{type:_angular_core.NgModule,args:[{declarations:[InfiniteScrollDirective],exports:[InfiniteScrollDirective],imports:[],providers:[PositionResolver,ScrollRegister]}]}],InfiniteScrollModule.ctorParameters=function(){return[]},exports.InfiniteScrollDirective=InfiniteScrollDirective,exports.PositionResolver=PositionResolver,exports.AxisResolver=AxisResolver,exports.ScrollRegister=ScrollRegister,exports.ScrollResolver=ScrollResolver,exports.InfiniteScrollModule=InfiniteScrollModule,Object.defineProperty(exports,"__esModule",{value:!0})}); | ||
!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?factory(exports,require("@angular/core"),require("rxjs/Observable"),require("rxjs/add/observable/fromEvent"),require("rxjs/add/observable/of"),require("rxjs/add/operator/sampleTime"),require("rxjs/add/operator/filter"),require("rxjs/add/operator/mergeMap")):"function"==typeof define&&define.amd?define(["exports","@angular/core","rxjs/Observable","rxjs/add/observable/fromEvent","rxjs/add/observable/of","rxjs/add/operator/sampleTime","rxjs/add/operator/filter","rxjs/add/operator/mergeMap"],factory):factory((global.ng=global.ng||{},global.ng.ngxInfiniteScroll=global.ng.ngxInfiniteScroll||{}),global.ng.core,global.Rx)}(this,function(exports,_angular_core,rxjs_Observable){"use strict";function resolveContainerElement(selector,scrollWindow,defaultElement){var hasWindow=window&&window.hasOwnProperty("document"),containerIsString=selector&&hasWindow&&"string"==typeof selector,container=containerIsString?window.document.querySelector(selector):selector;return selector||(container=scrollWindow?window:defaultElement),container}var PositionResolver=function(){function PositionResolver(){}return PositionResolver.prototype.create=function(options){var isWindow=this.isElementWindow(options.windowElement);return{axis:options.axis,container:this.defineContainer(options.windowElement,isWindow),isWindow:isWindow}},PositionResolver.prototype.defineContainer=function(windowElement,isContainerWindow){return isContainerWindow||!windowElement.nativeElement?windowElement:windowElement.nativeElement},PositionResolver.prototype.isElementWindow=function(windowElement){return["Window","global"].some(function(obj){return Object.prototype.toString.call(windowElement).includes(obj)})},PositionResolver.prototype.getDocumentElement=function(isContainerWindow,windowElement){return isContainerWindow?windowElement.document.documentElement:null},PositionResolver.prototype.calculatePoints=function(element,resolver){return resolver.isWindow?this.calculatePointsForWindow(element,resolver):this.calculatePointsForElement(element,resolver)},PositionResolver.prototype.calculatePointsForWindow=function(element,resolver){var axis=resolver.axis,container=resolver.container,isWindow=resolver.isWindow,offsetHeightKey=axis.offsetHeightKey(),clientHeightKey=axis.clientHeightKey(),height=(axis.topKey(),this.height(container,isWindow,offsetHeightKey,clientHeightKey)),scrolledUntilNow=height+this.pageYOffset(this.getDocumentElement(isWindow,container),axis,isWindow),nativeElementHeight=this.height(element.nativeElement,isWindow,offsetHeightKey,clientHeightKey);return{height:height,scrolledUntilNow:scrolledUntilNow,totalToScroll:this.offsetTop(element.nativeElement,axis,isWindow)+nativeElementHeight}},PositionResolver.prototype.calculatePointsForElement=function(element,resolver){var axis=resolver.axis,container=resolver.container,isWindow=resolver.isWindow,offsetHeightKey=axis.offsetHeightKey(),clientHeightKey=axis.clientHeightKey(),scrollTop=axis.scrollTopKey(),scrollHeight=axis.scrollHeightKey(),height=(axis.topKey(),this.height(container,isWindow,offsetHeightKey,clientHeightKey)),scrolledUntilNow=container[scrollTop],offsetTop=this.offsetTop(container,axis,isWindow);return void 0!==offsetTop&&offsetTop,{height:height,scrolledUntilNow:scrolledUntilNow,totalToScroll:container[scrollHeight]}},PositionResolver.prototype.height=function(elem,isWindow,offsetHeightKey,clientHeightKey){return isNaN(elem[offsetHeightKey])?this.getDocumentElement(isWindow,elem)[clientHeightKey]:elem[offsetHeightKey]},PositionResolver.prototype.offsetTop=function(elem,axis,isWindow){var topKey=axis.topKey();if(elem.getBoundingClientRect)return elem.getBoundingClientRect()[topKey]+this.pageYOffset(elem,axis,isWindow)},PositionResolver.prototype.pageYOffset=function(elem,axis,isWindow){var pageYOffset=axis.pageYOffsetKey(),scrollTop=axis.scrollTopKey(),offsetTop=axis.offsetTopKey();return isNaN(window[pageYOffset])?this.getDocumentElement(isWindow,elem)[scrollTop]:elem.ownerDocument?elem.ownerDocument.defaultView[pageYOffset]:elem[offsetTop]},PositionResolver}();PositionResolver.decorators=[{type:_angular_core.Injectable}],PositionResolver.ctorParameters=function(){return[]};var ScrollRegister=function(){function ScrollRegister(){}return ScrollRegister.prototype.attachEvent=function(options){return rxjs_Observable.Observable.fromEvent(options.container,"scroll").sampleTime(options.throttleDuration).filter(options.filterBefore).mergeMap(function(ev){return rxjs_Observable.Observable.of(options.mergeMap(ev))}).subscribe(options.scrollHandler)},ScrollRegister}();ScrollRegister.decorators=[{type:_angular_core.Injectable}],ScrollRegister.ctorParameters=function(){return[]};var ScrollResolver=function(){function ScrollResolver(){this.lastScrollPosition=0}return ScrollResolver.prototype.shouldScroll=function(container,config,scrollingDown){var remaining,containerBreakpoint,distance=config.distance;scrollingDown?(remaining=container.totalToScroll-container.scrolledUntilNow,containerBreakpoint=container.height*distance.down+1):(remaining=container.scrolledUntilNow,containerBreakpoint=container.height*distance.up+1);var shouldScroll=remaining<=containerBreakpoint;return this.lastScrollPosition=container.scrolledUntilNow,shouldScroll},ScrollResolver.prototype.isScrollingDown=function(container){return this.lastScrollPosition<container.scrolledUntilNow},ScrollResolver.prototype.getScrollStats=function(container,config){var isScrollingDown=this.isScrollingDown(container);return{isScrollingDown:isScrollingDown,shouldScroll:this.shouldScroll(container,config,isScrollingDown)}},ScrollResolver}();ScrollResolver.decorators=[{type:_angular_core.Injectable}],ScrollResolver.ctorParameters=function(){return[]};var AxisResolver=function(){function AxisResolver(vertical){void 0===vertical&&(vertical=!0),this.vertical=vertical}return AxisResolver.prototype.clientHeightKey=function(){return this.vertical?"clientHeight":"clientWidth"},AxisResolver.prototype.offsetHeightKey=function(){return this.vertical?"offsetHeight":"offsetWidth"},AxisResolver.prototype.scrollHeightKey=function(){return this.vertical?"scrollHeight":"scrollWidth"},AxisResolver.prototype.pageYOffsetKey=function(){return this.vertical?"pageYOffset":"pageXOffset"},AxisResolver.prototype.offsetTopKey=function(){return this.vertical?"offsetTop":"offsetLeft"},AxisResolver.prototype.scrollTopKey=function(){return this.vertical?"scrollTop":"scrollLeft"},AxisResolver.prototype.topKey=function(){return this.vertical?"top":"left"},AxisResolver}(),InfiniteScrollDirective=function(){function InfiniteScrollDirective(element,zone,positionResolver,scrollRegister,scrollerResolver){this.element=element,this.zone=zone,this.positionResolver=positionResolver,this.scrollRegister=scrollRegister,this.scrollerResolver=scrollerResolver,this.scrolled=new _angular_core.EventEmitter,this.scrolledUp=new _angular_core.EventEmitter,this.infiniteScrollDistance=2,this.infiniteScrollUpDistance=1.5,this.infiniteScrollThrottle=300,this.infiniteScrollDisabled=!1,this.infiniteScrollContainer=null,this.scrollWindow=!0,this.immediateCheck=!1,this.horizontal=!1,this.alwaysCallback=!1}return InfiniteScrollDirective.prototype.ngOnInit=function(){this.setup()},InfiniteScrollDirective.prototype.ngOnChanges=function(_a){var infiniteScrollContainer=_a.infiniteScrollContainer;infiniteScrollContainer&&!infiniteScrollContainer.firstChange&&(this.destroyScroller(),this.setup())},InfiniteScrollDirective.prototype.setup=function(){var _this=this;"undefined"!=typeof window&&this.zone.runOutsideAngular(function(){var containerElement=resolveContainerElement(_this.infiniteScrollContainer,_this.scrollWindow,_this.element),resolver=_this.positionResolver.create({axis:new AxisResolver(!_this.horizontal),windowElement:containerElement}),options={container:resolver.container,filterBefore:function(){return!_this.infiniteScrollDisabled},mergeMap:function(){return _this.positionResolver.calculatePoints(_this.element,resolver)},scrollHandler:function(container){return _this.handleOnScroll(container)},throttleDuration:_this.infiniteScrollThrottle};_this.disposeScroller=_this.scrollRegister.attachEvent(options)})},InfiniteScrollDirective.prototype.handleOnScroll=function(container){var distance={down:this.infiniteScrollDistance,up:this.infiniteScrollUpDistance},scrollStats=this.scrollerResolver.getScrollStats(container,{distance:distance});if(this.shouldTriggerEvents(scrollStats.shouldScroll)){var infiniteScrollEvent={currentScrollPosition:container.scrolledUntilNow};scrollStats.isScrollingDown?this.onScrollDown(infiniteScrollEvent):this.onScrollUp(infiniteScrollEvent)}},InfiniteScrollDirective.prototype.shouldTriggerEvents=function(shouldScroll){return(this.alwaysCallback||shouldScroll)&&!this.infiniteScrollDisabled},InfiniteScrollDirective.prototype.ngOnDestroy=function(){this.destroyScroller()},InfiniteScrollDirective.prototype.onScrollDown=function(data){var _this=this;void 0===data&&(data={currentScrollPosition:0}),this.zone.run(function(){return _this.scrolled.emit(data)})},InfiniteScrollDirective.prototype.onScrollUp=function(data){var _this=this;void 0===data&&(data={currentScrollPosition:0}),this.zone.run(function(){return _this.scrolledUp.emit(data)})},InfiniteScrollDirective.prototype.destroyScroller=function(){this.disposeScroller&&this.disposeScroller.unsubscribe()},InfiniteScrollDirective}();InfiniteScrollDirective.decorators=[{type:_angular_core.Directive,args:[{providers:[ScrollResolver],selector:"[infiniteScroll], [infinite-scroll], [data-infinite-scroll]"}]}],InfiniteScrollDirective.ctorParameters=function(){return[{type:_angular_core.ElementRef},{type:_angular_core.NgZone},{type:PositionResolver},{type:ScrollRegister},{type:ScrollResolver}]},InfiniteScrollDirective.propDecorators={scrolled:[{type:_angular_core.Output}],scrolledUp:[{type:_angular_core.Output}],infiniteScrollDistance:[{type:_angular_core.Input}],infiniteScrollUpDistance:[{type:_angular_core.Input}],infiniteScrollThrottle:[{type:_angular_core.Input}],infiniteScrollDisabled:[{type:_angular_core.Input}],infiniteScrollContainer:[{type:_angular_core.Input}],scrollWindow:[{type:_angular_core.Input}],immediateCheck:[{type:_angular_core.Input}],horizontal:[{type:_angular_core.Input}],alwaysCallback:[{type:_angular_core.Input}]};var InfiniteScrollModule=function(){function InfiniteScrollModule(){}return InfiniteScrollModule}();InfiniteScrollModule.decorators=[{type:_angular_core.NgModule,args:[{declarations:[InfiniteScrollDirective],exports:[InfiniteScrollDirective],imports:[],providers:[PositionResolver,ScrollRegister]}]}],InfiniteScrollModule.ctorParameters=function(){return[]},exports.InfiniteScrollDirective=InfiniteScrollDirective,exports.PositionResolver=PositionResolver,exports.AxisResolver=AxisResolver,exports.ScrollRegister=ScrollRegister,exports.ScrollResolver=ScrollResolver,exports.InfiniteScrollModule=InfiniteScrollModule,Object.defineProperty(exports,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=ngx-infinite-scroll.umd.min.js.map |
@@ -40,3 +40,3 @@ import { Directive, ElementRef, EventEmitter, Injectable, Input, NgModule, NgZone, Output } from '@angular/core'; | ||
PositionResolver.prototype.isElementWindow = function (windowElement) { | ||
var /** @type {?} */ isWindow = Object.prototype.toString.call(windowElement).includes('Window'); | ||
var /** @type {?} */ isWindow = ['Window', 'global'].some(function (obj) { return Object.prototype.toString.call(windowElement).includes(obj); }); | ||
return isWindow; | ||
@@ -43,0 +43,0 @@ }; |
@@ -39,3 +39,3 @@ import { Directive, ElementRef, EventEmitter, Injectable, Input, NgModule, NgZone, Output } from '@angular/core'; | ||
isElementWindow(windowElement) { | ||
const /** @type {?} */ isWindow = Object.prototype.toString.call(windowElement).includes('Window'); | ||
const /** @type {?} */ isWindow = ['Window', 'global'].some((obj) => Object.prototype.toString.call(windowElement).includes(obj)); | ||
return isWindow; | ||
@@ -42,0 +42,0 @@ } |
{ | ||
"name": "ngx-infinite-scroll", | ||
"version": "0.5.2-0", | ||
"version": "0.5.2", | ||
"description": "An infinite scroll directive for Angular compatible with AoT compilation and Tree shaking", | ||
@@ -16,3 +16,4 @@ "main": "./bundles/ngx-infinite-scroll.umd.js", | ||
"compodoc-serve": "compodoc -s", | ||
"transpile": "ngc -p ./tsconfig.json" | ||
"transpile": "ngc -p ./tsconfig.json", | ||
"serve:prod": "npm run build && lite-server -c ./example/bs-config.json" | ||
}, | ||
@@ -19,0 +20,0 @@ "typings": "./ngx-infinite-scroll.d.ts", |
[![Build Status](https://travis-ci.org/orizens/ngx-infinite-scroll.svg?branch=master)](https://travis-ci.org/orizens/ngx-infinite-scroll) | ||
# Angular Infinite Scroll | ||
Inspired by [ng-infinite-scroll](https://github.com/sroze/ngInfiniteScroll) directive for angular (> 2, 4). | ||
Inspired by [ng-infinite-scroll](https://github.com/sroze/ngInfiniteScroll) directive for angular. | ||
## Angular Support | ||
Supports Angular **> 4** | ||
**Supports Angular > 4** | ||
For Angular version **<= 2.3.1**, you can use ```npm i angular2-infinite-scroll``` (latest version is 0.3.42) - please notice **the angular2-infinite-scroll** package is deprecated | ||
@@ -34,2 +34,4 @@ | ||
* **infiniteScrollDisabled**<_boolean_> - (optional, default: **false**) - doesn't invoke the handler if set to true | ||
* **horizontal**<_boolean_> - (optional, default: false) - sets the scroll to listen for horizontal events | ||
* **alwaysCallback**<_boolean_> - (optional, default: false) - instructs the scroller to always trigger events | ||
@@ -77,3 +79,3 @@ ## Behavior | ||
[infiniteScrollDistance]="2" | ||
[infiniteScrollThrottle]="300" | ||
[infiniteScrollThrottle]="50" | ||
(scrolled)="onScroll()"> | ||
@@ -106,3 +108,3 @@ </div> | ||
[infiniteScrollDistance]="2" | ||
[infiniteScrollThrottle]="500" | ||
[infiniteScrollThrottle]="50" | ||
(scrolled)="onScroll()" | ||
@@ -134,3 +136,3 @@ [scrollWindow]="false"> | ||
[infiniteScrollUpDistance]="1.5" | ||
[infiniteScrollThrottle]="500" | ||
[infiniteScrollThrottle]="50" | ||
(scrolled)="onScrollDown()" | ||
@@ -137,0 +139,0 @@ (scrolledUp)="onScrollUp()"> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
206084
152