Merge pull request #211 from NativeScript/feature/css-loading-fix

Css loading fix
This commit is contained in:
Alexander Vakrilov
2015-03-20 16:33:11 +02:00

View File

@@ -58,7 +58,7 @@ function resolvePageFromEntry(entry: definition.NavigationEntry): pages.Page {
page = moduleExports.createPage(); page = moduleExports.createPage();
} }
else { else {
page = pageFromBuilder(moduleNamePath, entry.moduleName, moduleExports); page = pageFromBuilder(moduleNamePath, moduleExports);
} }
if (!(page && page instanceof pages.Page)) { if (!(page && page instanceof pages.Page)) {
@@ -82,7 +82,7 @@ function resolveFilePath(path, ext) {
return fileNameResolver.resolveFileName(path, ext); return fileNameResolver.resolveFileName(path, ext);
} }
function pageFromBuilder(moduleNamePath: string, moduleName: string, moduleExports: any): pages.Page { function pageFromBuilder(moduleNamePath: string, moduleExports: any): pages.Page {
var page: pages.Page; var page: pages.Page;
var element: view.View; var element: view.View;
@@ -97,7 +97,7 @@ function pageFromBuilder(moduleNamePath: string, moduleName: string, moduleExpor
page = <pages.Page>element; page = <pages.Page>element;
// Possible CSS file path. // Possible CSS file path.
var cssFileName = resolveFilePath(moduleName, "css"); var cssFileName = resolveFilePath(moduleNamePath, "css");
if (cssFileName) { if (cssFileName) {
page.addCssFile(cssFileName); page.addCssFile(cssFileName);
} }