From b21c48f3d1d38063a8483a58f61bf2c1ab2375c6 Mon Sep 17 00:00:00 2001 From: Tsvetan Raikov Date: Wed, 6 Apr 2016 17:34:07 +0300 Subject: [PATCH] Fixed: CSS animations from the application-wide .css file do not aply --- application/application-common.ts | 3 ++- application/application.d.ts | 1 + ui/styling/style-scope.d.ts | 4 ++-- ui/styling/style-scope.ts | 5 ++++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/application/application-common.ts b/application/application-common.ts index cc47c5139..93c4c78eb 100644 --- a/application/application-common.ts +++ b/application/application-common.ts @@ -28,6 +28,7 @@ export var appSelectors: Array = []; export var additionalSelectors: Array = []; export var cssSelectors: Array = []; export var cssSelectorVersion: number = 0; +export var keyframes: any = {}; export var resources: any = {}; @@ -82,5 +83,5 @@ export function parseCss(cssText: string, cssFileName?: string): Array; export var cssSelectorVersion: number; + export var keyframes: any; export function parseCss(cssText: string, cssFileName?: string): Array; export function mergeCssSelectors(module: any): void; //@endprivate diff --git a/ui/styling/style-scope.d.ts b/ui/styling/style-scope.d.ts index 555a76d84..6828cf8fd 100644 --- a/ui/styling/style-scope.d.ts +++ b/ui/styling/style-scope.d.ts @@ -9,8 +9,8 @@ declare module "ui/styling/style-scope" { public css: string; public addCss(cssString: string, cssFileName: string): void; - public static createSelectorsFromCss(css: string, cssFileName: string): cssSelector.CssSelector[]; - public static createSelectorsFromImports(tree: cssParser.SyntaxTree): cssSelector.CssSelector[]; + public static createSelectorsFromCss(css: string, cssFileName: string, keyframes: Object): cssSelector.CssSelector[]; + public static createSelectorsFromImports(tree: cssParser.SyntaxTree, keyframes: Object): cssSelector.CssSelector[]; public ensureSelectors(): boolean; public applySelectors(view: view.View): void diff --git a/ui/styling/style-scope.ts b/ui/styling/style-scope.ts index 67e92259e..03559e16b 100644 --- a/ui/styling/style-scope.ts +++ b/ui/styling/style-scope.ts @@ -71,7 +71,7 @@ export class StyleScope { private setCss(cssString: string, cssFileName?: string, append: boolean = false): void { this._css = this._css ? this._css + cssString : cssString; if (cssFileName) { - this._cssFileName = cssFileName + this._cssFileName = cssFileName; } this._reset(); @@ -169,6 +169,9 @@ export class StyleScope { this._applicationCssSelectorsAppliedVersion = application.cssSelectorVersion; toMerge.push(this._localCssSelectors); this._localCssSelectorsAppliedVersion = this._localCssSelectorVersion; + for (let keyframe in application.keyframes) { + this._keyframes[keyframe] = application.keyframes[keyframe]; + } } if (toMerge.length > 0) {