revert: fix(animations): ensure all child elements are rendered before running animations

This reverts commit cbe85a0893.
This commit is contained in:
Matias Niemelä
2016-07-07 14:12:17 -07:00
parent cbe85a0893
commit f1fc1dc669
20 changed files with 81 additions and 283 deletions

View File

@ -11,7 +11,7 @@ import {isPresent} from '../facade/lang';
import {AnimationPlayer} from './animation_player';
export class ViewAnimationMap {
export class ActiveAnimationPlayersMap {
private _map = new Map<any, {[key: string]: AnimationPlayer}>();
private _allPlayers: AnimationPlayer[] = [];
@ -25,9 +25,9 @@ export class ViewAnimationMap {
}
findAllPlayersByElement(element: any): AnimationPlayer[] {
var players: AnimationPlayer[] = [];
var players: any[] /** TODO #9100 */ = [];
StringMapWrapper.forEach(
this._map.get(element), (player: AnimationPlayer) => players.push(player));
this._map.get(element), (player: any /** TODO #9100 */) => players.push(player));
return players;
}

View File

@ -14,8 +14,6 @@ import {AnimationPlayer} from './animation_player';
export class AnimationGroupPlayer implements AnimationPlayer {
private _subscriptions: Function[] = [];
private _finished = false;
private _started = false;
public parentPlayer: AnimationPlayer = null;
constructor(private _players: AnimationPlayer[]) {
@ -46,19 +44,9 @@ export class AnimationGroupPlayer implements AnimationPlayer {
}
}
init(): void { this._players.forEach(player => player.init()); }
onDone(fn: Function): void { this._subscriptions.push(fn); }
hasStarted() { return this._started; }
play() {
if (!isPresent(this.parentPlayer)) {
this.init();
}
this._started = true;
this._players.forEach(player => player.play());
}
play() { this._players.forEach(player => player.play()); }
pause(): void { this._players.forEach(player => player.pause()); }

View File

@ -15,8 +15,6 @@ import {scheduleMicroTask} from '../facade/lang';
*/
export abstract class AnimationPlayer {
abstract onDone(fn: Function): void;
abstract init(): void;
abstract hasStarted(): boolean;
abstract play(): void;
abstract pause(): void;
abstract restart(): void;
@ -33,7 +31,6 @@ export abstract class AnimationPlayer {
export class NoOpAnimationPlayer implements AnimationPlayer {
private _subscriptions: any[] /** TODO #9100 */ = [];
private _started = false;
public parentPlayer: AnimationPlayer = null;
constructor() { scheduleMicroTask(() => this._onFinish()); }
/** @internal */
@ -42,9 +39,7 @@ export class NoOpAnimationPlayer implements AnimationPlayer {
this._subscriptions = [];
}
onDone(fn: Function): void { this._subscriptions.push(fn); }
hasStarted(): boolean { return this._started; }
init(): void {}
play(): void { this._started = true; }
play(): void {}
pause(): void {}
restart(): void {}
finish(): void { this._onFinish(); }

View File

@ -15,7 +15,6 @@ export class AnimationSequencePlayer implements AnimationPlayer {
private _activePlayer: AnimationPlayer;
private _subscriptions: Function[] = [];
private _finished = false;
private _started: boolean = false;
public parentPlayer: AnimationPlayer = null;
@ -55,19 +54,9 @@ export class AnimationSequencePlayer implements AnimationPlayer {
}
}
init(): void { this._players.forEach(player => player.init()); }
onDone(fn: Function): void { this._subscriptions.push(fn); }
hasStarted() { return this._started; }
play(): void {
if (!isPresent(this.parentPlayer)) {
this.init();
}
this._started = true;
this._activePlayer.play();
}
play(): void { this._activePlayer.play(); }
pause(): void { this._activePlayer.pause(); }