Fixed tslint errors

This commit is contained in:
Panayot Cankov
2017-02-08 17:14:20 +02:00
parent 23658c9719
commit b12f112a44
3 changed files with 12 additions and 7 deletions

View File

@ -6,7 +6,6 @@ import * as animationModule from "ui/animation";
import * as colorModule from "color"; import * as colorModule from "color";
import * as enums from "ui/enums"; import * as enums from "ui/enums";
import * as frame from "ui/frame"; import * as frame from "ui/frame";
import * as trace from "trace";
export class ViewModel extends observable.Observable { export class ViewModel extends observable.Observable {
constructor() { constructor() {

View File

@ -3,7 +3,7 @@ import {
AnimationBase, Properties, PropertyAnimation, CubicBezierAnimationCurve, AnimationPromise, AnimationBase, Properties, PropertyAnimation, CubicBezierAnimationCurve, AnimationPromise,
opacityProperty, backgroundColorProperty, rotateProperty, opacityProperty, backgroundColorProperty, rotateProperty,
translateXProperty, translateYProperty, translateXProperty, translateYProperty,
scaleXProperty, scaleYProperty, Color, traceWrite, traceEnabled, traceCategories, unsetValue scaleXProperty, scaleYProperty, Color, traceWrite, traceEnabled, traceCategories
} from "./animation-common"; } from "./animation-common";
import { CacheLayerType, layout } from "utils/utils"; import { CacheLayerType, layout } from "utils/utils";

View File

@ -584,7 +584,7 @@ export class CssAnimationProperty<T extends Style, U> {
let prev = this[computedValue]; let prev = this[computedValue];
if (value === unsetValue) { if (value === unsetValue) {
this[symbol] = unsetValue; this[symbol] = unsetValue;
if (this[computedSource] == propertySource) { if (this[computedSource] === propertySource) {
// Fallback to lower value source. // Fallback to lower value source.
if (this[styleValue] !== unsetValue) { if (this[styleValue] !== unsetValue) {
this[computedSource] = ValueSource.Local; this[computedSource] = ValueSource.Local;
@ -609,9 +609,15 @@ export class CssAnimationProperty<T extends Style, U> {
} }
let next = this[computedValue]; let next = this[computedValue];
if (prev !== next && (!equalityComparer || !equalityComparer(prev, next))) { if (prev !== next && (!equalityComparer || !equalityComparer(prev, next))) {
valueChanged && valueChanged(this, prev, next); if (valueChanged) {
this.view.nativeView && (this.view[native] = next); valueChanged(this, prev, next);
this.hasListeners(eventName) && this.notify({ eventName, object: this, propertyName, value }); }
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<T extends Style, U> {
Object.defineProperty(cls.prototype, defaultName, defaultPropertyDescriptor); Object.defineProperty(cls.prototype, defaultName, defaultPropertyDescriptor);
Object.defineProperty(cls.prototype, cssName, cssPropertyDescriptor); Object.defineProperty(cls.prototype, cssName, cssPropertyDescriptor);
Object.defineProperty(cls.prototype, propertyName, stylePropertyDescriptor); 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, options.cssName, stylePropertyDescriptor);
} }
Object.defineProperty(cls.prototype, keyframeName, keyframePropertyDescriptor); Object.defineProperty(cls.prototype, keyframeName, keyframePropertyDescriptor);