mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
support for custom components CSS added
This commit is contained in:
@@ -20,7 +20,7 @@ var navigationBarHiddenProperty = new dependencyObservable.Property(
|
||||
);
|
||||
|
||||
function onNavigationBarHiddenPropertyChanged(data: dependencyObservable.PropertyChangeData) {
|
||||
console.log("onNavigationBarHiddenPropertyChanged("+data.newValue+")");
|
||||
console.log("onNavigationBarHiddenPropertyChanged(" + data.newValue + ")");
|
||||
var page = <Page>data.object;
|
||||
if (page.isLoaded) {
|
||||
page._updateNavigationBar(data.newValue);
|
||||
@@ -116,15 +116,18 @@ export class Page extends contentView.ContentView implements dts.Page, view.AddA
|
||||
this._refreshCss();
|
||||
}
|
||||
|
||||
private _cssFiles = {};
|
||||
public addCssFile(cssFileName: string) {
|
||||
if (cssFileName.indexOf(fs.knownFolders.currentApp().path) !== 0) {
|
||||
cssFileName = fs.path.join(fs.knownFolders.currentApp().path, cssFileName);
|
||||
}
|
||||
|
||||
var cssString;
|
||||
if (fs.File.exists(cssFileName)) {
|
||||
new fileSystemAccess.FileSystemAccess().readText(cssFileName, r => { cssString = r; });
|
||||
this._addCssInternal(cssString, cssFileName);
|
||||
if (!this._cssFiles[cssFileName]) {
|
||||
if (fs.File.exists(cssFileName)) {
|
||||
new fileSystemAccess.FileSystemAccess().readText(cssFileName, r => {
|
||||
this._addCssInternal(r, cssFileName);
|
||||
this._cssFiles[cssFileName] = true;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user