Skip to content

Commit 98a3519

Browse files
committed
fix(nav): rename animate to animated
1 parent aa53563 commit 98a3519

File tree

10 files changed

+43
-283
lines changed

10 files changed

+43
-283
lines changed

core/src/components/animation-controller/animator.tsx

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -702,11 +702,8 @@ export class Animator {
702702

703703
} else if (tweenEffect) {
704704
// EVERYTHING IN BETWEEN
705-
let valNum = (((toNum - fromNum) * stepValue) + fromNum);
705+
const valNum = (((toNum - fromNum) * stepValue) + fromNum);
706706
const unit = fx.to.effectUnit;
707-
if (unit === 'px') {
708-
valNum = valNum;
709-
}
710707
val = valNum + unit;
711708
}
712709

@@ -819,7 +816,6 @@ export class Animator {
819816
const addClasses = this._beforeAddClasses;
820817
const removeClasses = this._beforeRemoveClasses;
821818

822-
let prop: string;
823819
for (let i = 0; i < elements.length; i++) {
824820
const el = elements[i];
825821
const elementClassList = el.classList;
@@ -834,6 +830,7 @@ export class Animator {
834830

835831
// css classes to remove before the animation
836832
if (removeClasses) {
833+
837834
for (let j = 0; j < removeClasses.length; j++) {
838835
// ******** DOM WRITE ****************
839836
elementClassList.remove(removeClasses[j]);
@@ -842,7 +839,7 @@ export class Animator {
842839

843840
// inline styles to add before the animation
844841
if (this._beforeStyles) {
845-
for (prop in this._beforeStyles) {
842+
for (const prop in this._beforeStyles) {
846843
// ******** DOM WRITE ****************
847844
(el as any).style[prop] = this._beforeStyles[prop];
848845
}
@@ -919,24 +916,27 @@ export class Animator {
919916
// finished in reverse direction
920917

921918
// css classes that were added before the animation should be removed
922-
if (this._beforeAddClasses) {
923-
for (j = 0; j < this._beforeAddClasses.length; j++) {
919+
const beforeAddClasses = this._beforeAddClasses;
920+
if (beforeAddClasses) {
921+
for (j = 0; j < beforeAddClasses.length; j++) {
924922
// ******** DOM WRITE ****************
925-
elementClassList.remove(this._beforeAddClasses[j]);
923+
elementClassList.remove(beforeAddClasses[j]);
926924
}
927925
}
928926

929927
// css classes that were removed before the animation should be added
930-
if (this._beforeRemoveClasses) {
931-
for (j = 0; j < this._beforeRemoveClasses.length; j++) {
928+
const beforeRemoveClasses = this._beforeRemoveClasses;
929+
if (beforeRemoveClasses) {
930+
for (j = 0; j < beforeRemoveClasses.length; j++) {
932931
// ******** DOM WRITE ****************
933-
elementClassList.add(this._beforeRemoveClasses[j]);
932+
elementClassList.add(beforeRemoveClasses[j]);
934933
}
935934
}
936935

937936
// inline styles that were added before the animation should be removed
938-
if (this._beforeStyles) {
939-
for (prop in this._beforeStyles) {
937+
const beforeStyles = this._beforeStyles;
938+
if (beforeStyles) {
939+
for (prop in beforeStyles) {
940940
// ******** DOM WRITE ****************
941941
(el as any).style[prop] = '';
942942
}
@@ -946,26 +946,29 @@ export class Animator {
946946
// finished in forward direction
947947

948948
// css classes to add after the animation
949-
if (this._afterAddClasses) {
950-
for (j = 0; j < this._afterAddClasses.length; j++) {
949+
const afterAddClasses = this._afterAddClasses;
950+
if (afterAddClasses) {
951+
for (j = 0; j < afterAddClasses.length; j++) {
951952
// ******** DOM WRITE ****************
952-
elementClassList.add(this._afterAddClasses[j]);
953+
elementClassList.add(afterAddClasses[j]);
953954
}
954955
}
955956

956957
// css classes to remove after the animation
957-
if (this._afterRemoveClasses) {
958-
for (j = 0; j < this._afterRemoveClasses.length; j++) {
958+
const afterRemoveClasses = this._afterRemoveClasses;
959+
if (afterRemoveClasses) {
960+
for (j = 0; j < afterRemoveClasses.length; j++) {
959961
// ******** DOM WRITE ****************
960-
elementClassList.remove(this._afterRemoveClasses[j]);
962+
elementClassList.remove(afterRemoveClasses[j]);
961963
}
962964
}
963965

964966
// inline styles to add after the animation
965-
if (this._afterStyles) {
966-
for (prop in this._afterStyles) {
967+
const afterStyles = this._afterStyles;
968+
if (afterStyles) {
969+
for (prop in afterStyles) {
967970
// ******** DOM WRITE ****************
968-
(el as any).style[prop] = this._afterStyles[prop];
971+
(el as any).style[prop] = afterStyles[prop];
969972
}
970973
}
971974
}

core/src/components/datetime/datetime.tsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -274,15 +274,6 @@ export class Datetime {
274274

275275
const picker = this.pickerCtrl.create(pickerOptions);
276276

277-
// picker.ionChange.subscribe(() => {
278-
// this.validate();
279-
// picker.refresh();
280-
// });
281-
282-
// picker.onDidDismiss(() => {
283-
// this._fireBlur();
284-
// });
285-
286277
console.debug('Built Datetime: Picker with', pickerOptions);
287278
return picker;
288279
}

core/src/components/gesture-controller/test/gesture-controller.spec.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { GestureController, } from '../gesture-controller';
22

33
describe('gesture controller', () => {
4+
45
it('should create an instance of GestureController', () => {
56
const c = new GestureController();
67
expect(c.isCaptured()).toEqual(false);

core/src/components/nav/nav-interface.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export interface NavResult {
1616
}
1717

1818
export interface RouterOutletOptions {
19-
animate?: boolean;
19+
animated?: boolean;
2020
animationBuilder?: AnimationBuilder;
2121
duration?: number;
2222
easing?: string;

core/src/components/nav/nav.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ export class Nav implements NavOutlet {
154154
opts = {};
155155
}
156156
// if animation wasn't set to true then default it to NOT animate
157-
if (opts.animate !== true) {
158-
opts.animate = false;
157+
if (opts.animated !== true) {
158+
opts.animated = false;
159159
}
160160
return this.queueTrns({
161161
insertStart: 0,
@@ -199,7 +199,7 @@ export class Nav implements NavOutlet {
199199
} else if (direction === 1) {
200200
finish = this.push(id, params, commonOpts);
201201
} else if (direction === -1) {
202-
finish = this.setRoot(id, params, {...commonOpts, direction: 'back', animate: true});
202+
finish = this.setRoot(id, params, {...commonOpts, direction: 'back', animated: true});
203203
} else {
204204
finish = this.setRoot(id, params, commonOpts);
205205
}
@@ -559,7 +559,7 @@ export class Nav implements NavOutlet {
559559
const leavingEl = leavingView && leavingView.element!;
560560
const animationOpts: TransitionOptions = {
561561
mode: this.mode,
562-
animate: this.animated,
562+
animated: this.animated,
563563
showGoBack: this.canGoBack(enteringView),
564564
animationCtrl: this.animationCtrl,
565565
progressCallback,

0 commit comments

Comments
 (0)