Fix application.cssFile var, promoted to get/set function

This commit is contained in:
Panayot Cankov
2017-03-09 13:47:36 +02:00
parent 0b4e38acab
commit b487aa0790
3 changed files with 12 additions and 9 deletions

View File

@@ -20,7 +20,7 @@ export const lowMemoryEvent = "lowMemory";
export const uncaughtErrorEvent = "uncaughtError";
export const orientationChangedEvent = "orientationChanged";
export let cssFile: string = "app.css";
let cssFile: string = "app.css";
export let mainModule: string;
export let mainEntry: NavigationEntry;
@@ -48,10 +48,14 @@ export function livesync() {
}
export function setCssFileName(cssFileName: string) {
exports.cssFile = cssFileName;
cssFile = cssFileName;
events.notify(<CssChangedEventData>{ eventName: "cssChanged", object: app, cssFile: cssFileName });
}
export function getCssFileName(): string {
return cssFile;
}
export function addCss(cssText: string): void {
events.notify(<CssChangedEventData>{ eventName: "cssChanged", object: app, cssText: cssText });
}

View File

@@ -126,17 +126,16 @@ export var resources: any;
*/
export function setResources(resources: any);
/**
* The application level css file name (starting from the application root). Used to set css across all pages.
* Css will be applied for every page and page css will be applied after.
*/
export var cssFile: string;
/**
* Sets css file name for the application.
*/
export function setCssFileName(cssFile: string): void;
/**
* Gets css file name for the application.
*/
export function getCssFileName(): string;
export function addCss(cssText: string): void;
/**

View File

@@ -372,4 +372,4 @@ class InlineSelector extends SelectorCore {
public match(node: Node): boolean { return true; }
}
loadCss(application.cssFile);
loadCss(application.getCssFileName());