mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
perf(animation): using will-change when using progressStep()
This commit is contained in:
committed by
Adam Bradley
parent
4e88f89161
commit
267aa32f5a
@@ -618,16 +618,21 @@ export class Animation {
|
||||
}
|
||||
|
||||
if (Object.keys(this._fx).length) {
|
||||
easing = (forcedLinearEasing ? 'linear' : this.getEasing());
|
||||
for (i = 0; i < this._el.length; i++) {
|
||||
// all parent/child animations should have the same duration
|
||||
// ******** DOM WRITE ****************
|
||||
this._el[i].style[CSS.transitionDuration] = duration + 'ms';
|
||||
|
||||
// each animation can have a different easing
|
||||
easing = (forcedLinearEasing ? 'linear' : this.getEasing());
|
||||
if (easing) {
|
||||
if (duration > 0) {
|
||||
// all parent/child animations should have the same duration
|
||||
// ******** DOM WRITE ****************
|
||||
this._el[i].style[CSS.transitionTimingFn] = easing;
|
||||
this._el[i].style[CSS.transition] = '';
|
||||
this._el[i].style[CSS.transitionDuration] = duration + 'ms';
|
||||
|
||||
// each animation can have a different easing
|
||||
if (easing) {
|
||||
// ******** DOM WRITE ****************
|
||||
this._el[i].style[CSS.transitionTimingFn] = easing;
|
||||
}
|
||||
} else {
|
||||
this._el[i].style[CSS.transition] = 'none';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -824,6 +829,9 @@ export class Animation {
|
||||
this._c[i].progressStart();
|
||||
}
|
||||
|
||||
// ******** DOM WRITE ****************
|
||||
this._willChg(true);
|
||||
|
||||
// ******** DOM WRITE ****************
|
||||
this._before();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user