Skip to content

Commit

Permalink
skip auditTime if set to 0ms
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewseguin committed Jan 17, 2017
1 parent 59e6fd8 commit c5de08b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/lib/core/overlay/scroll/scroll-dispatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ export class ScrollDispatcher {
* to override the default "throttle" time.
*/
scrolled(auditTimeInMs: number = DEFAULT_AUDIT_TIME): Observable<void> {
// In the case of a 0ms delay, return the observable without auditTime since it does add
// a perceptible delay in processing overhead.
if (auditTimeInMs == 0) {
return this._scrolled.asObservable();
}

return this._scrolled.asObservable().auditTime(auditTimeInMs);
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib/tooltip/tooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export type TooltipPosition = 'left' | 'right' | 'above' | 'below' | 'before' |
export const TOUCHEND_HIDE_DELAY = 1500;

/** Time in ms to throttle repositioning after scroll events. */
export const SCROLL_THROTTLE_MS = 10;
export const SCROLL_THROTTLE_MS = 0;

/**
* Directive that attaches a material design tooltip to the host element. Animates the showing and
Expand Down

0 comments on commit c5de08b

Please sign in to comment.