refactor(animations): inline css animations

This commit is contained in:
Adam Bradley
2016-02-09 16:22:40 -06:00
parent de76cefcf3
commit da18868636
94 changed files with 1071 additions and 6905 deletions

View File

@@ -30,11 +30,11 @@ export class Platform {
private _qs: any;
private _ua: string;
private _bPlt: string;
private _onResizes: Array<any>=[];
private _onResizes: Array<Function>=[];
private _readyPromise: Promise<any>;
private _readyResolve: any;
private _engineReady: any;
private _resizeTimer: any;
private _resizeTm: any;
/**
* @private
@@ -361,9 +361,9 @@ export class Platform {
*/
windowResize() {
let self = this;
clearTimeout(self._resizeTimer);
clearTimeout(self._resizeTm);
self._resizeTimer = setTimeout(() => {
self._resizeTm = setTimeout(() => {
flushDimensionCache();
for (let i = 0; i < self._onResizes.length; i++) {
@@ -373,14 +373,23 @@ export class Platform {
console.error(e);
}
}
}, 250);
}, 200);
}
/**
* @private
*/
onResize(cb: Function) {
this._onResizes.push(cb);
* @private
* @returns Unregister function
*/
onResize(cb: Function): Function {
let self = this;
self._onResizes.push(cb);
return function() {
let index = self._onResizes.indexOf(cb);
if (index > -1) {
self._onResizes.splice(index, 1);
}
};
}
@@ -602,11 +611,12 @@ function insertSuperset(platformNode: PlatformNode) {
class PlatformNode {
private c: any;
public parent: PlatformNode;
public child: PlatformNode;
public isEngine: boolean;
public depth: number;
private c;
parent: PlatformNode;
child: PlatformNode;
isEngine: boolean;
depth: number;
constructor(platformName: string) {
this.c = Platform.get(platformName);