angular2-infinite-scroll
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
function __export(m) { | ||
@@ -2,0 +3,0 @@ for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; |
@@ -1,6 +0,7 @@ | ||
System.registerDynamic("src/infinite-scroll", ["angular2/core", "./scroller"], true, function($__require, exports, module) { | ||
System.registerDynamic("src/infinite-scroll", ["@angular/core", "./scroller"], true, function($__require, exports, module) { | ||
"use strict"; | ||
; | ||
var global = this, | ||
__define = global.define; | ||
global.define = undefined; | ||
var define, | ||
global = this, | ||
GLOBAL = this; | ||
var __decorate = (this && this.__decorate) || function(decorators, target, key, desc) { | ||
@@ -22,3 +23,3 @@ var c = arguments.length, | ||
}; | ||
var core_1 = $__require('angular2/core'); | ||
var core_1 = $__require('@angular/core'); | ||
var scroller_1 = $__require('./scroller'); | ||
@@ -28,2 +29,3 @@ var InfiniteScroll = (function() { | ||
this.element = element; | ||
this._distance = 2; | ||
this.scrolled = new core_1.EventEmitter(); | ||
@@ -41,2 +43,5 @@ } | ||
}; | ||
InfiniteScroll.prototype.ngOnDestroy = function() { | ||
this.scroller.clean(); | ||
}; | ||
InfiniteScroll.prototype.onScroll = function() { | ||
@@ -49,5 +54,4 @@ this.scrolled.next({}); | ||
return InfiniteScroll; | ||
})(); | ||
}()); | ||
exports.InfiniteScroll = InfiniteScroll; | ||
global.define = __define; | ||
return module.exports; | ||
@@ -57,6 +61,7 @@ }); | ||
System.registerDynamic("src/scroller", [], true, function($__require, exports, module) { | ||
"use strict"; | ||
; | ||
var global = this, | ||
__define = global.define; | ||
global.define = undefined; | ||
var define, | ||
global = this, | ||
GLOBAL = this; | ||
var Scroller = (function() { | ||
@@ -173,7 +178,15 @@ function Scroller($window, $interval, $elementRef, infiniteScrollCallback, infiniteScrollDistance, infiniteScrollParent) { | ||
Scroller.prototype.changeContainer = function(newContainer) { | ||
this.clean(); | ||
this.container = newContainer; | ||
if (newContainer != null) { | ||
return this.container.addEventListener('scroll', this.handler.bind(this)); | ||
this.bindedHandler = this.handler.bind(this); | ||
return this.container.addEventListener('scroll', this.bindedHandler); | ||
} | ||
}; | ||
Scroller.prototype.clean = function() { | ||
if (this.container !== undefined) { | ||
this.container.removeEventListener('scroll', this.bindedHandler); | ||
this.bindedHandler = null; | ||
} | ||
}; | ||
Scroller.prototype.handleInfiniteScrollDisabled = function(v) { | ||
@@ -183,5 +196,4 @@ this.scrollEnabled = !v; | ||
return Scroller; | ||
})(); | ||
}()); | ||
exports.Scroller = Scroller; | ||
global.define = __define; | ||
return module.exports; | ||
@@ -191,6 +203,7 @@ }); | ||
System.registerDynamic("angular2-infinite-scroll", ["./src/infinite-scroll", "./src/scroller"], true, function($__require, exports, module) { | ||
"use strict"; | ||
; | ||
var global = this, | ||
__define = global.define; | ||
global.define = undefined; | ||
var define, | ||
global = this, | ||
GLOBAL = this; | ||
function __export(m) { | ||
@@ -207,4 +220,3 @@ for (var p in m) | ||
exports.default = {directives: [infinite_scroll_1.InfiniteScroll, scroller_1.Scroller]}; | ||
global.define = __define; | ||
return module.exports; | ||
}); |
@@ -15,3 +15,3 @@ var pkg = require('./package.json'); | ||
typescript: './node_modules/typescript/lib/typescript.js', | ||
angular2: path.resolve('node_modules/angular2'), | ||
'@angular': path.resolve('node_modules/@angular'), | ||
rxjs: path.resolve('node_modules/rxjs') | ||
@@ -23,3 +23,3 @@ }, | ||
meta: { | ||
'node_modules/angular2/*': { build: false }, | ||
'node_modules/@angular/*': { build: false }, | ||
'node_modules/rxjs/*': { build: false } | ||
@@ -26,0 +26,0 @@ }, |
{ | ||
"name": "angular2-infinite-scroll", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "An infinite scroll directive for angular2", | ||
@@ -19,3 +19,3 @@ "main": "angular2-infinite-scroll.js", | ||
"devDependencies": { | ||
"angular2": "2.0.0-beta.6", | ||
"@angular/core": "^2.0.0-rc.1", | ||
"autodts": "0.0.6", | ||
@@ -27,5 +27,6 @@ "path": "^0.12.7", | ||
"reflect-metadata": "0.1.2", | ||
"rxjs": "5.0.0-beta.0", | ||
"zone.js": "0.5.14" | ||
"rxjs": "5.0.0-beta.6", | ||
"systemjs-builder": "^0.15.16", | ||
"zone.js": "0.6.12" | ||
} | ||
} |
@@ -18,3 +18,3 @@ # Angular 2 Infinite Scroll | ||
selector: 'app', | ||
directives: [ InfiniteScroll ] | ||
directives: [ InfiniteScroll ], | ||
template: ` | ||
@@ -21,0 +21,0 @@ <div class="search-results" |
@@ -1,4 +0,6 @@ | ||
import { ElementRef, EventEmitter } from 'angular2/core'; | ||
export declare class InfiniteScroll { | ||
import { ElementRef, EventEmitter, OnDestroy, OnInit } from '@angular/core'; | ||
export declare class InfiniteScroll implements OnDestroy, OnInit { | ||
private element; | ||
private scroller; | ||
private _distance; | ||
infiniteScrollDistance: number; | ||
@@ -8,5 +10,4 @@ scrolled: EventEmitter<{}>; | ||
ngOnInit(): void; | ||
private scroller; | ||
private _distance; | ||
ngOnDestroy(): void; | ||
onScroll(): void; | ||
} |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
@@ -10,3 +11,3 @@ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
}; | ||
var core_1 = require('angular2/core'); | ||
var core_1 = require('@angular/core'); | ||
var scroller_1 = require('./scroller'); | ||
@@ -16,2 +17,3 @@ var InfiniteScroll = (function () { | ||
this.element = element; | ||
this._distance = 2; | ||
this.scrolled = new core_1.EventEmitter(); | ||
@@ -29,2 +31,5 @@ } | ||
}; | ||
InfiniteScroll.prototype.ngOnDestroy = function () { | ||
this.scroller.clean(); | ||
}; | ||
InfiniteScroll.prototype.onScroll = function () { | ||
@@ -49,4 +54,4 @@ this.scrolled.next({}); | ||
return InfiniteScroll; | ||
})(); | ||
}()); | ||
exports.InfiniteScroll = InfiniteScroll; | ||
//# sourceMappingURL=infinite-scroll.js.map |
@@ -14,2 +14,3 @@ export declare class Scroller { | ||
$elementRef: any; | ||
private bindedHandler; | ||
constructor($window: any, $interval: any, $elementRef: any, infiniteScrollCallback: any, infiniteScrollDistance: number, infiniteScrollParent: any); | ||
@@ -23,3 +24,4 @@ height(elem: any): any; | ||
changeContainer(newContainer: any): any; | ||
clean(): void; | ||
handleInfiniteScrollDisabled(v: any): void; | ||
} |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
var Scroller = (function () { | ||
@@ -125,10 +126,15 @@ function Scroller($window, $interval, $elementRef, infiniteScrollCallback, infiniteScrollDistance, infiniteScrollParent) { | ||
Scroller.prototype.changeContainer = function (newContainer) { | ||
// if (this.container != null) { | ||
// this.container.unbind('scroll', this.handler); | ||
// } | ||
this.clean(); | ||
this.container = newContainer; | ||
if (newContainer != null) { | ||
return this.container.addEventListener('scroll', this.handler.bind(this)); | ||
this.bindedHandler = this.handler.bind(this); | ||
return this.container.addEventListener('scroll', this.bindedHandler); | ||
} | ||
}; | ||
Scroller.prototype.clean = function () { | ||
if (this.container !== undefined) { | ||
this.container.removeEventListener('scroll', this.bindedHandler); | ||
this.bindedHandler = null; | ||
} | ||
}; | ||
Scroller.prototype.handleInfiniteScrollDisabled = function (v) { | ||
@@ -142,4 +148,4 @@ this.scrollEnabled = !v; | ||
return Scroller; | ||
})(); | ||
}()); | ||
exports.Scroller = Scroller; | ||
//# sourceMappingURL=scroller.js.map |
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
519
27292
10
15