"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/cdk/scrolling/virtual-scroll-viewport.ts" between
material2-7.3.3.tar.gz and material2-7.3.4.tar.gz

About: material2 offers Material Design components for Angular.

virtual-scroll-viewport.ts  (material2-7.3.3):virtual-scroll-viewport.ts  (material2-7.3.4)
skipping to change at line 26 skipping to change at line 26
Inject, Inject,
Input, Input,
NgZone, NgZone,
OnDestroy, OnDestroy,
OnInit, OnInit,
Optional, Optional,
Output, Output,
ViewChild, ViewChild,
ViewEncapsulation, ViewEncapsulation,
} from '@angular/core'; } from '@angular/core';
import {animationFrameScheduler, Observable, Subject, Observer} from 'rxjs'; import {animationFrameScheduler, asapScheduler, Observable, Subject, Observer} f rom 'rxjs';
import {auditTime, startWith, takeUntil} from 'rxjs/operators'; import {auditTime, startWith, takeUntil} from 'rxjs/operators';
import {ScrollDispatcher} from './scroll-dispatcher'; import {ScrollDispatcher} from './scroll-dispatcher';
import {CdkScrollable, ExtendedScrollToOptions} from './scrollable'; import {CdkScrollable, ExtendedScrollToOptions} from './scrollable';
import {CdkVirtualForOf} from './virtual-for-of'; import {CdkVirtualForOf} from './virtual-for-of';
import {VIRTUAL_SCROLL_STRATEGY, VirtualScrollStrategy} from './virtual-scroll-s trategy'; import {VIRTUAL_SCROLL_STRATEGY, VirtualScrollStrategy} from './virtual-scroll-s trategy';
/** Checks if the given ranges are equal. */ /** Checks if the given ranges are equal. */
function rangesEqual(r1: ListRange, r2: ListRange): boolean { function rangesEqual(r1: ListRange, r2: ListRange): boolean {
return r1.start == r2.start && r1.end == r2.end; return r1.start == r2.start && r1.end == r2.end;
} }
/**
* Scheduler to be used for scroll events. Needs to fall back to
* something that doesn't rely on requestAnimationFrame on environments
* that don't support it (e.g. server-side rendering).
*/
const SCROLL_SCHEDULER =
typeof requestAnimationFrame !== 'undefined' ? animationFrameScheduler : asa
pScheduler;
/** A viewport that virtualizes it's scrolling with the help of `CdkVirtualForOf `. */ /** A viewport that virtualizes it's scrolling with the help of `CdkVirtualForOf `. */
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'cdk-virtual-scroll-viewport', selector: 'cdk-virtual-scroll-viewport',
templateUrl: 'virtual-scroll-viewport.html', templateUrl: 'virtual-scroll-viewport.html',
styleUrls: ['virtual-scroll-viewport.css'], styleUrls: ['virtual-scroll-viewport.css'],
host: { host: {
'class': 'cdk-virtual-scroll-viewport', 'class': 'cdk-virtual-scroll-viewport',
'[class.cdk-virtual-scroll-orientation-horizontal]': 'orientation === "horiz ontal"', '[class.cdk-virtual-scroll-orientation-horizontal]': 'orientation === "horiz ontal"',
'[class.cdk-virtual-scroll-orientation-vertical]': 'orientation !== "horizon tal"', '[class.cdk-virtual-scroll-orientation-vertical]': 'orientation !== "horizon tal"',
skipping to change at line 158 skipping to change at line 166
this._measureViewportSize(); this._measureViewportSize();
this._scrollStrategy.attach(this); this._scrollStrategy.attach(this);
this.elementScrolled() this.elementScrolled()
.pipe( .pipe(
// Start off with a fake scroll event so we properly detect our in itial position. // Start off with a fake scroll event so we properly detect our in itial position.
startWith<Event | null>(null!), startWith<Event | null>(null!),
// Collect multiple events into one until the next animation frame . This way if // Collect multiple events into one until the next animation frame . This way if
// there are multiple scroll events in the same frame we only need to recheck // there are multiple scroll events in the same frame we only need to recheck
// our layout once. // our layout once.
auditTime(0, animationFrameScheduler)) auditTime(0, SCROLL_SCHEDULER))
.subscribe(() => this._scrollStrategy.onContentScrolled()); .subscribe(() => this._scrollStrategy.onContentScrolled());
this._markChangeDetectionNeeded(); this._markChangeDetectionNeeded();
})); }));
} }
ngOnDestroy() { ngOnDestroy() {
this.detach(); this.detach();
this._scrollStrategy.detach(); this._scrollStrategy.detach();
 End of changes. 3 change blocks. 
2 lines changed or deleted 11 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)