Skip to content

Commit 4d10101

Browse files
author
vakrilov
committed
var -> let cleanup
1 parent ef6a24a commit 4d10101

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

tns-core-modules/ui/frame/frame.ios.ts

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ import * as types from "utils/types";
1010
import application = require("application");
1111
import * as _transitionModule from "ui/transition";
1212

13-
var transitionModule: typeof _transitionModule;
13+
let transitionModule: typeof _transitionModule;
1414

1515
global.moduleMerge(frameCommon, exports);
1616

17-
var ENTRY = "_entry";
18-
var NAV_DEPTH = "_navDepth";
19-
var TRANSITION = "_transition";
20-
var DELEGATE = "_delegate";
21-
var navDepth = -1;
17+
const ENTRY = "_entry";
18+
const NAV_DEPTH = "_navDepth";
19+
const TRANSITION = "_transition";
20+
const DELEGATE = "_delegate";
21+
let navDepth = -1;
2222

2323
export class Frame extends frameCommon.Frame {
2424
private _ios: iOSFrame;
@@ -123,7 +123,7 @@ export class Frame extends frameCommon.Frame {
123123
// We should clear the entire history.
124124
if (clearHistory) {
125125
viewController.navigationItem.hidesBackButton = true;
126-
var newControllers = NSMutableArray.alloc().initWithCapacity(1);
126+
let newControllers = NSMutableArray.alloc().initWithCapacity(1);
127127
newControllers.addObject(viewController);
128128
this._ios.controller.setViewControllersAnimated(newControllers, animated);
129129
if (trace.enabled) {
@@ -135,7 +135,7 @@ export class Frame extends frameCommon.Frame {
135135

136136
// We should hide the current entry from the back stack.
137137
if (!Frame._isEntryBackstackVisible(this._currentEntry)) {
138-
var newControllers = NSMutableArray.alloc().initWithArray(this._ios.controller.viewControllers);
138+
let newControllers = NSMutableArray.alloc().initWithArray(this._ios.controller.viewControllers);
139139
if (newControllers.count === 0) {
140140
throw new Error("Wrong controllers count.");
141141
}
@@ -145,7 +145,7 @@ export class Frame extends frameCommon.Frame {
145145
viewController.navigationItem.hidesBackButton = this.backStack.length === 0;
146146

147147
// swap the top entry with the new one
148-
var skippedNavController = newControllers.lastObject;
148+
const skippedNavController = newControllers.lastObject;
149149
skippedNavController.isBackstackSkipped = true;
150150
newControllers.removeLastObject();
151151
newControllers.addObject(viewController);
@@ -171,8 +171,8 @@ export class Frame extends frameCommon.Frame {
171171
navDepth = backstackEntry[NAV_DEPTH];
172172

173173
if (!this._shouldSkipNativePop) {
174-
var controller = backstackEntry.resolvedPage.ios;
175-
var animated = this._currentEntry ? this._getIsAnimatedNavigation(this._currentEntry.entry) : false;
174+
let controller = backstackEntry.resolvedPage.ios;
175+
let animated = this._currentEntry ? this._getIsAnimatedNavigation(this._currentEntry.entry) : false;
176176

177177
this._updateActionBar(backstackEntry.resolvedPage);
178178
if (trace.enabled) {
@@ -185,8 +185,8 @@ export class Frame extends frameCommon.Frame {
185185
public _updateActionBar(page?: Page): void {
186186
super._updateActionBar(page);
187187

188-
var page = page || this.currentPage;
189-
var newValue = this._getNavBarVisible(page);
188+
page = page || this.currentPage;
189+
let newValue = this._getNavBarVisible(page);
190190

191191
this._ios.showNavigationBar = newValue;
192192
if (this._ios.controller.navigationBar) {
@@ -242,7 +242,7 @@ export class Frame extends frameCommon.Frame {
242242
public requestLayout(): void {
243243
super.requestLayout();
244244
// Invalidate our Window so that layout is triggered again.
245-
var window = this._nativeView.window;
245+
let window = this._nativeView.window;
246246
if (window) {
247247
window.setNeedsLayout();
248248
}
@@ -308,7 +308,7 @@ export class Frame extends frameCommon.Frame {
308308
}
309309

310310
public get navigationBarHeight(): number {
311-
var navigationBar = this._ios.controller.navigationBar;
311+
let navigationBar = this._ios.controller.navigationBar;
312312
return (navigationBar && !this._ios.controller.navigationBarHidden) ? navigationBar.frame.size.height : 0;
313313
}
314314

@@ -348,7 +348,7 @@ export class Frame extends frameCommon.Frame {
348348
if (trace.enabled) {
349349
trace.write(`Forcing navigationBar.frame.origin.y to ${statusBarHeight} due to a higher in-call status-bar`, trace.categories.Layout);
350350
}
351-
351+
352352
this._ios.controller.navigationBar.autoresizingMask = UIViewAutoresizing.UIViewAutoresizingNone;
353353
this._ios.controller.navigationBar.removeConstraints((<any>this)._ios.controller.navigationBar.constraints);
354354
this._ios.controller.navigationBar.frame = CGRectMake(
@@ -390,7 +390,7 @@ class TransitionDelegate extends NSObject {
390390
}
391391
}
392392

393-
var index = transitionDelegates.indexOf(this);
393+
let index = transitionDelegates.indexOf(this);
394394
if (index > -1) {
395395
transitionDelegates.splice(index, 1);
396396
}
@@ -402,7 +402,7 @@ class TransitionDelegate extends NSObject {
402402
};
403403
}
404404

405-
var _defaultTransitionDuration = 0.35;
405+
const _defaultTransitionDuration = 0.35;
406406

407407
class UINavigationControllerAnimatedDelegate extends NSObject implements UINavigationControllerDelegate {
408408
public static ObjCProtocols = [UINavigationControllerDelegate];
@@ -435,7 +435,7 @@ class UINavigationControllerAnimatedDelegate extends NSObject implements UINavig
435435
if (trace.enabled) {
436436
trace.write(`UINavigationControllerImpl.navigationControllerAnimationControllerForOperationFromViewControllerToViewController(${operation}, ${fromVC}, ${toVC}), transition: ${JSON.stringify(navigationTransition)}`, trace.categories.NativeLifecycle);
437437
}
438-
438+
439439
if (!transitionModule) {
440440
transitionModule = require("ui/transition");
441441
}
@@ -450,7 +450,7 @@ class UINavigationControllerImpl extends UINavigationController {
450450
private _owner: WeakRef<Frame>;
451451

452452
public static initWithOwner(owner: WeakRef<Frame>): UINavigationControllerImpl {
453-
var controller = <UINavigationControllerImpl>UINavigationControllerImpl.new();
453+
let controller = <UINavigationControllerImpl>UINavigationControllerImpl.new();
454454
controller._owner = owner;
455455
return controller;
456456
}
@@ -473,7 +473,7 @@ class UINavigationControllerImpl extends UINavigationController {
473473
if (trace.enabled) {
474474
trace.write(this._owner + " viewDidLayoutSubviews, isLoaded = " + owner.isLoaded, trace.categories.ViewHierarchy);
475475
}
476-
476+
477477
owner._updateLayout();
478478
}
479479
}
@@ -524,8 +524,8 @@ class UINavigationControllerImpl extends UINavigationController {
524524
}
525525

526526
public setViewControllersAnimated(viewControllers: NSArray, animated: boolean): void {
527-
var viewController = viewControllers.lastObject;
528-
var navigationTransition = <definition.NavigationTransition>viewController[TRANSITION];
527+
let viewController = viewControllers.lastObject;
528+
let navigationTransition = <definition.NavigationTransition>viewController[TRANSITION];
529529
if (trace.enabled) {
530530
trace.write(`UINavigationControllerImpl.setViewControllersAnimated(${viewControllers}, ${animated}); transition: ${JSON.stringify(navigationTransition)}`, trace.categories.NativeLifecycle);
531531
}
@@ -542,8 +542,8 @@ class UINavigationControllerImpl extends UINavigationController {
542542
}
543543

544544
public popViewControllerAnimated(animated: boolean): UIViewController {
545-
var lastViewController = this.viewControllers.lastObject;
546-
var navigationTransition = <definition.NavigationTransition>lastViewController[TRANSITION];
545+
let lastViewController = this.viewControllers.lastObject;
546+
let navigationTransition = <definition.NavigationTransition>lastViewController[TRANSITION];
547547
if (trace.enabled) {
548548
trace.write(`UINavigationControllerImpl.popViewControllerAnimated(${animated}); transition: ${JSON.stringify(navigationTransition)}`, trace.categories.NativeLifecycle);
549549
}
@@ -553,7 +553,7 @@ class UINavigationControllerImpl extends UINavigationController {
553553
return super.popViewControllerAnimated(false);
554554
}
555555

556-
var nativeTransition = _getNativeTransition(navigationTransition, false);
556+
let nativeTransition = _getNativeTransition(navigationTransition, false);
557557
if (!animated || !navigationTransition || !nativeTransition) {
558558
return super.popViewControllerAnimated(animated);
559559
}
@@ -591,7 +591,7 @@ class UINavigationControllerImpl extends UINavigationController {
591591
}
592592

593593
function _getTransitionId(nativeTransition: UIViewAnimationTransition, transitionType: string): string {
594-
var name;
594+
let name;
595595
switch (nativeTransition) {
596596
case UIViewAnimationTransition.UIViewAnimationTransitionCurlDown: name = "CurlDown"; break;
597597
case UIViewAnimationTransition.UIViewAnimationTransitionCurlUp: name = "CurlUp"; break;
@@ -663,7 +663,7 @@ class iOSFrame implements definition.iOSFrame {
663663
private _showNavigationBar: boolean;
664664
private _navBarVisibility: string;
665665
private _frame: Frame;
666-
666+
667667
// TabView uses this flag to disable animation while showing/hiding the navigation bar because of the "< More" bar.
668668
// See the TabView._handleTwoNavigationBars method for more details.
669669
public _disableNavBarAnimation: boolean;
@@ -684,7 +684,7 @@ class iOSFrame implements definition.iOSFrame {
684684
return this._showNavigationBar;
685685
}
686686
public set showNavigationBar(value: boolean) {
687-
var change = this._showNavigationBar !== value;
687+
let change = this._showNavigationBar !== value;
688688
this._showNavigationBar = value;
689689

690690
let animated = !this._frame._isInitialNavigation && !this._disableNavBarAnimation;

0 commit comments

Comments
 (0)