mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
refactor(animations): inline css animations
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user