From a526e6cec8af2ffa118ff68dd73b8c6ab921bbee Mon Sep 17 00:00:00 2001 From: Hristo Deshev Date: Fri, 7 Aug 2015 10:45:42 +0300 Subject: [PATCH] Making tslint happy. --- ui/core/view-common.ts | 11 +++++++---- ui/core/view.d.ts | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ui/core/view-common.ts b/ui/core/view-common.ts index ac189c752..eb02cd8d0 100644 --- a/ui/core/view-common.ts +++ b/ui/core/view-common.ts @@ -57,14 +57,16 @@ export function eachDescendant(view: definition.View, callback: (child: View) => export function getAncestor(view: View, criterion: string | Function): definition.View { let matcher: (view: definition.View) => boolean = null; - if (typeof criterion === "string") + if (typeof criterion === "string") { matcher = (view: definition.View) => view.typeName === criterion; - else + } else { matcher = (view: definition.View) => view instanceof criterion; + } for (let parent: definition.View = view.parent; parent != null; parent = parent.parent) { - if (matcher(parent)) + if (matcher(parent)) { return parent; + } } return null; @@ -337,8 +339,9 @@ export class View extends proxy.ProxyObject implements definition.View { } get page(): definition.View { - if (this.parent) + if (this.parent) { return this.parent.page; + } return null; } diff --git a/ui/core/view.d.ts b/ui/core/view.d.ts index 05afe220b..b2fbfdc5d 100644 --- a/ui/core/view.d.ts +++ b/ui/core/view.d.ts @@ -22,7 +22,7 @@ declare module "ui/core/view" { */ export function eachDescendant(view: View, callback: (child: View) => boolean); - /** + /** * Gets an ancestor from a given type. * @param view - Starting view (child view). * @param criterion - The type of ancestor view we are looking for. Could be a string containing a class name or an actual type.