From b12f112a445183f3e0b25fab6e6b8870abdcca01 Mon Sep 17 00:00:00 2001 From: Panayot Cankov Date: Wed, 8 Feb 2017 17:14:20 +0200 Subject: [PATCH] Fixed tslint errors --- .../gallery-app/animations/js-configurable.ts | 1 - .../ui/animation/animation.android.ts | 2 +- tns-core-modules/ui/core/properties.ts | 16 +++++++++++----- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/apps/app/gallery-app/animations/js-configurable.ts b/apps/app/gallery-app/animations/js-configurable.ts index e73566053..cdb1f1635 100644 --- a/apps/app/gallery-app/animations/js-configurable.ts +++ b/apps/app/gallery-app/animations/js-configurable.ts @@ -6,7 +6,6 @@ import * as animationModule from "ui/animation"; import * as colorModule from "color"; import * as enums from "ui/enums"; import * as frame from "ui/frame"; -import * as trace from "trace"; export class ViewModel extends observable.Observable { constructor() { diff --git a/tns-core-modules/ui/animation/animation.android.ts b/tns-core-modules/ui/animation/animation.android.ts index ea13a594b..330a22083 100644 --- a/tns-core-modules/ui/animation/animation.android.ts +++ b/tns-core-modules/ui/animation/animation.android.ts @@ -3,7 +3,7 @@ import { AnimationBase, Properties, PropertyAnimation, CubicBezierAnimationCurve, AnimationPromise, opacityProperty, backgroundColorProperty, rotateProperty, translateXProperty, translateYProperty, - scaleXProperty, scaleYProperty, Color, traceWrite, traceEnabled, traceCategories, unsetValue + scaleXProperty, scaleYProperty, Color, traceWrite, traceEnabled, traceCategories } from "./animation-common"; import { CacheLayerType, layout } from "utils/utils"; diff --git a/tns-core-modules/ui/core/properties.ts b/tns-core-modules/ui/core/properties.ts index 4a1f3c154..46b425874 100644 --- a/tns-core-modules/ui/core/properties.ts +++ b/tns-core-modules/ui/core/properties.ts @@ -584,7 +584,7 @@ export class CssAnimationProperty { let prev = this[computedValue]; if (value === unsetValue) { this[symbol] = unsetValue; - if (this[computedSource] == propertySource) { + if (this[computedSource] === propertySource) { // Fallback to lower value source. if (this[styleValue] !== unsetValue) { this[computedSource] = ValueSource.Local; @@ -609,9 +609,15 @@ export class CssAnimationProperty { } let next = this[computedValue]; if (prev !== next && (!equalityComparer || !equalityComparer(prev, next))) { - valueChanged && valueChanged(this, prev, next); - this.view.nativeView && (this.view[native] = next); - this.hasListeners(eventName) && this.notify({ eventName, object: this, propertyName, value }); + if (valueChanged) { + valueChanged(this, prev, next); + } + if (this.view.nativeView) { + this.view[native] = next; + } + if (this.hasListeners(eventName)) { + this.notify({ eventName, object: this, propertyName, value }); + } } } } @@ -637,7 +643,7 @@ export class CssAnimationProperty { Object.defineProperty(cls.prototype, defaultName, defaultPropertyDescriptor); Object.defineProperty(cls.prototype, cssName, cssPropertyDescriptor); Object.defineProperty(cls.prototype, propertyName, stylePropertyDescriptor); - if (options.cssName && options.cssName != options.name) { + if (options.cssName && options.cssName !== options.name) { Object.defineProperty(cls.prototype, options.cssName, stylePropertyDescriptor); } Object.defineProperty(cls.prototype, keyframeName, keyframePropertyDescriptor);