@blinkk/degu
Advanced tools
Comparing version 0.0.318 to 0.0.319
@@ -8,3 +8,2 @@ import { ProgressWatcher } from '../dom/progress-watcher'; | ||
export declare class InviewProgress { | ||
private currentProgress; | ||
private progressWatcher; | ||
@@ -11,0 +10,0 @@ constructor(); |
@@ -6,3 +6,2 @@ "use strict"; | ||
constructor() { | ||
this.currentProgress = 0; | ||
this.progressWatcher = new progress_watcher_1.ProgressWatcher(); | ||
@@ -18,13 +17,10 @@ } | ||
this.progressWatcher.add({ | ||
range: inviewProgressItem.range[0], | ||
range: inviewProgressItem.range, | ||
callback: (progress, direction) => { | ||
(direction == -1) ? setInactive() : setActive(); | ||
setActive(); | ||
}, | ||
inactiveCallback: (progress, direction) => { | ||
setInactive(); | ||
} | ||
}); | ||
this.progressWatcher.add({ | ||
range: inviewProgressItem.range[1], | ||
callback: (progress, direction) => { | ||
(direction == 1) ? setInactive() : setActive(); | ||
} | ||
}); | ||
} | ||
@@ -31,0 +27,0 @@ clear() { |
export interface ProgressWatcherItem { | ||
range: number | Array<number>; | ||
callback: Function; | ||
inactiveCallback?: Function; | ||
runWhen?: Function; | ||
@@ -5,0 +6,0 @@ } |
@@ -42,2 +42,7 @@ "use strict"; | ||
} | ||
else { | ||
if (watcher.inactiveCallback) { | ||
watcher.inactiveCallback(this.currentProgress, this.direction); | ||
} | ||
} | ||
}); | ||
@@ -44,0 +49,0 @@ } |
{ | ||
"name": "@blinkk/degu", | ||
"version": "0.0.318", | ||
"version": "0.0.319", | ||
"description": "A general utility library for interactive websites, with a focus on performance.", | ||
@@ -5,0 +5,0 @@ "author": "Blinkk <hello@blinkk.com>", |
16343
587692