mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 19:26:42 +08:00
Changed the patch to eliminate duplicate code now it only has the css loaded in one spot.
This commit is contained in:
@ -57,10 +57,6 @@ export function resolvePageFromEntry(entry: definition.NavigationEntry): pages.P
|
||||
if (moduleExports && moduleExports.createPage) {
|
||||
trace.write("Calling createPage()", trace.categories.Navigation);
|
||||
page = moduleExports.createPage();
|
||||
var cssFileName = fileResolverModule.resolveFileName(moduleNamePath, "css");
|
||||
if (cssFileName && page && page.addCssFile) {
|
||||
page.addCssFile(cssFileName);
|
||||
}
|
||||
}
|
||||
else {
|
||||
page = pageFromBuilder(moduleNamePath, moduleExports);
|
||||
@ -69,6 +65,12 @@ export function resolvePageFromEntry(entry: definition.NavigationEntry): pages.P
|
||||
if (!(page && page instanceof pages.Page)) {
|
||||
throw new Error("Failed to load Page from entry.moduleName: " + entry.moduleName);
|
||||
}
|
||||
|
||||
// Possible CSS file path.
|
||||
var cssFileName = fileResolverModule.resolveFileName(moduleNamePath, "css");
|
||||
if (cssFileName) {
|
||||
page.addCssFile(cssFileName);
|
||||
}
|
||||
}
|
||||
|
||||
return page;
|
||||
@ -87,12 +89,6 @@ function pageFromBuilder(moduleNamePath: string, moduleExports: any): pages.Page
|
||||
element = builder.load(fileName, moduleExports);
|
||||
if (element instanceof pages.Page) {
|
||||
page = <pages.Page>element;
|
||||
|
||||
// Possible CSS file path.
|
||||
var cssFileName = fileResolverModule.resolveFileName(moduleNamePath, "css");
|
||||
if (cssFileName) {
|
||||
page.addCssFile(cssFileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user