mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Expose hasLaunched() on the application, style-scope will load css-es if app hasLaunched
This commit is contained in:
@@ -74,7 +74,16 @@ function loadCss(cssFile?: string): RuleSet[] {
|
||||
|
||||
application.on("cssChanged", onCssChanged);
|
||||
application.on("livesync", onLiveSync);
|
||||
application.on("launch", () => loadCss(application.getCssFileName()));
|
||||
|
||||
function loadCssOnLaunch() {
|
||||
loadCss(application.getCssFileName());
|
||||
application.off("launch", loadCssOnLaunch);
|
||||
}
|
||||
if (application.hasLaunched()) {
|
||||
loadCssOnLaunch();
|
||||
} else {
|
||||
application.on("launch", loadCssOnLaunch);
|
||||
}
|
||||
|
||||
let pattern: RegExp = /('|")(.*?)\1/;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user