Tests added and master-detail tempalte updated

This commit is contained in:
vakrilov
2015-03-18 12:37:33 +02:00
parent 0b2c4cc523
commit 88f6a936fc
21 changed files with 439 additions and 144 deletions

View File

@@ -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);
}
}
}

View File

@@ -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() {