mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Fix application.cssFile var, promoted to get/set function
This commit is contained in:
@@ -20,7 +20,7 @@ export const lowMemoryEvent = "lowMemory";
|
|||||||
export const uncaughtErrorEvent = "uncaughtError";
|
export const uncaughtErrorEvent = "uncaughtError";
|
||||||
export const orientationChangedEvent = "orientationChanged";
|
export const orientationChangedEvent = "orientationChanged";
|
||||||
|
|
||||||
export let cssFile: string = "app.css";
|
let cssFile: string = "app.css";
|
||||||
|
|
||||||
export let mainModule: string;
|
export let mainModule: string;
|
||||||
export let mainEntry: NavigationEntry;
|
export let mainEntry: NavigationEntry;
|
||||||
@@ -48,10 +48,14 @@ export function livesync() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function setCssFileName(cssFileName: string) {
|
export function setCssFileName(cssFileName: string) {
|
||||||
exports.cssFile = cssFileName;
|
cssFile = cssFileName;
|
||||||
events.notify(<CssChangedEventData>{ eventName: "cssChanged", object: app, cssFile: cssFileName });
|
events.notify(<CssChangedEventData>{ eventName: "cssChanged", object: app, cssFile: cssFileName });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getCssFileName(): string {
|
||||||
|
return cssFile;
|
||||||
|
}
|
||||||
|
|
||||||
export function addCss(cssText: string): void {
|
export function addCss(cssText: string): void {
|
||||||
events.notify(<CssChangedEventData>{ eventName: "cssChanged", object: app, cssText: cssText });
|
events.notify(<CssChangedEventData>{ eventName: "cssChanged", object: app, cssText: cssText });
|
||||||
}
|
}
|
||||||
|
|||||||
11
tns-core-modules/application/application.d.ts
vendored
11
tns-core-modules/application/application.d.ts
vendored
@@ -126,17 +126,16 @@ export var resources: any;
|
|||||||
*/
|
*/
|
||||||
export function setResources(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.
|
* Sets css file name for the application.
|
||||||
*/
|
*/
|
||||||
export function setCssFileName(cssFile: string): void;
|
export function setCssFileName(cssFile: string): void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets css file name for the application.
|
||||||
|
*/
|
||||||
|
export function getCssFileName(): string;
|
||||||
|
|
||||||
export function addCss(cssText: string): void;
|
export function addCss(cssText: string): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -372,4 +372,4 @@ class InlineSelector extends SelectorCore {
|
|||||||
public match(node: Node): boolean { return true; }
|
public match(node: Node): boolean { return true; }
|
||||||
}
|
}
|
||||||
|
|
||||||
loadCss(application.cssFile);
|
loadCss(application.getCssFileName());
|
||||||
|
|||||||
Reference in New Issue
Block a user