mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Tests added and master-detail tempalte updated
This commit is contained in:
@@ -88,8 +88,7 @@ function pageFromBuilder(moduleNamePath: string, moduleName: string, moduleExpor
|
||||
|
||||
// Possible XML file path.
|
||||
var fileName = resolveFilePath(moduleNamePath, "xml");
|
||||
|
||||
if (fs.File.exists(fileName)) {
|
||||
if (fileName) {
|
||||
trace.write("Loading XML file: " + fileName, trace.categories.Navigation);
|
||||
|
||||
// Or check if the file exists in the app modules and load the page from XML.
|
||||
@@ -99,7 +98,9 @@ function pageFromBuilder(moduleNamePath: string, moduleName: string, moduleExpor
|
||||
|
||||
// Possible CSS file path.
|
||||
var cssFileName = resolveFilePath(moduleName, "css");
|
||||
page.addCssFile(cssFileName);
|
||||
if (cssFileName) {
|
||||
page.addCssFile(cssFileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -61,10 +61,13 @@ export class Page extends contentView.ContentView implements dts.Page {
|
||||
}
|
||||
|
||||
public addCssFile(cssFileName: string) {
|
||||
if (cssFileName.indexOf(fs.knownFolders.currentApp().path) !== 0) {
|
||||
cssFileName = fs.path.join(fs.knownFolders.currentApp().path, cssFileName);
|
||||
}
|
||||
|
||||
var cssString;
|
||||
var realCssFileName = fs.path.join(fs.knownFolders.currentApp().path, cssFileName);
|
||||
if (fs.File.exists(realCssFileName)) {
|
||||
new fileSystemAccess.FileSystemAccess().readText(realCssFileName, r => { cssString = r; });
|
||||
if (fs.File.exists(cssFileName)) {
|
||||
new fileSystemAccess.FileSystemAccess().readText(cssFileName, r => { cssString = r; });
|
||||
this._addCssInternal(cssString, cssFileName);
|
||||
}
|
||||
}
|
||||
@@ -104,18 +107,18 @@ export class Page extends contentView.ContentView implements dts.Page {
|
||||
return;
|
||||
}
|
||||
|
||||
this._styleScope.ensureSelectors();
|
||||
this._styleScope.ensureSelectors();
|
||||
|
||||
var scope = this._styleScope;
|
||||
var checkSelectors = (view: view.View): boolean => {
|
||||
scope.applySelectors(view);
|
||||
return true;
|
||||
}
|
||||
var scope = this._styleScope;
|
||||
var checkSelectors = (view: view.View): boolean => {
|
||||
scope.applySelectors(view);
|
||||
return true;
|
||||
}
|
||||
|
||||
checkSelectors(this);
|
||||
view.eachDescendant(this, checkSelectors);
|
||||
checkSelectors(this);
|
||||
view.eachDescendant(this, checkSelectors);
|
||||
|
||||
this._cssApplied = true;
|
||||
this._cssApplied = true;
|
||||
}
|
||||
|
||||
private _resetCssValues() {
|
||||
|
||||
Reference in New Issue
Block a user