Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions tns-core-modules/application/application.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,13 @@ export function run(entry?: NavigationEntry | string) {
_start(entry);
}

export function addCss(cssText: string): void {
export function addCss(cssText: string, attributeScoped?: boolean): void {
notify(<CssChangedEventData>{ eventName: "cssChanged", object: androidApp, cssText: cssText });
const rootView = getRootView();
if (rootView) {
rootView._onCssStateChange();
if (!attributeScoped) {
const rootView = getRootView();
if (rootView) {
rootView._onCssStateChange();
}
}
}

Expand Down
3 changes: 2 additions & 1 deletion tns-core-modules/application/application.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,9 @@ export function loadAppCss();
/**
* Adds new values to the application styles.
* @param cssText - A valid styles which will be added to the current application styles.
* @param attributeScoped - Whether the styles are attribute scoped. Adding attribute scoped styles will not perform a full application styling refresh.
*/
export function addCss(cssText: string): void;
export function addCss(cssText: string, attributeScoped?: boolean): void;

/**
* This event is raised when application css is changed.
Expand Down
10 changes: 6 additions & 4 deletions tns-core-modules/application/application.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -419,11 +419,13 @@ export function run(entry?: string | NavigationEntry) {
_start(entry);
}

export function addCss(cssText: string): void {
export function addCss(cssText: string, attributeScoped?: boolean): void {
notify(<CssChangedEventData>{ eventName: "cssChanged", object: <any>iosApp, cssText: cssText });
const rootView = getRootView();
if (rootView) {
rootView._onCssStateChange();
if (!attributeScoped) {
const rootView = getRootView();
if (rootView) {
rootView._onCssStateChange();
}
}
}

Expand Down