Fallback to default theme resources (#252)

This commit is contained in:
Blake Embrey
2016-07-17 18:18:47 -07:00
committed by GitHub
parent 155fa12831
commit 721a97ff46
3 changed files with 5 additions and 10 deletions

View File

@@ -199,14 +199,7 @@ export class Renderer extends ChildableComponent<Application, RendererComponent>
}
}
var filename = Path.join(path, 'theme.js');
if (!FS.existsSync(filename)) {
this.theme = this.addComponent("theme", new DefaultTheme(this, path));
} else {
// var themeClass = eval(Renderer.readFile(filename));
// this.theme = new themeClass(this, path);
this.theme = this.addComponent("theme", new DefaultTheme(this, path));
}
this.theme = this.addComponent("theme", new DefaultTheme(this, path));
}
this.theme.resources.activate();

View File

@@ -45,7 +45,7 @@ export interface ITemplateMapping
* [[BaseTheme]] implementation, this theme class will be used.
*/
export class DefaultTheme extends Theme
{
{
/**
* Mappings of reflections kinds to templates used by this theme.
*/

View File

@@ -5,6 +5,7 @@ import * as Util from "util";
import {Theme} from "../theme";
import {HelperStack} from "./resources/helpers";
import {TemplateStack, PartialStack} from "./resources/templates";
import {Renderer} from "../renderer";
export class Resources
@@ -29,7 +30,8 @@ export class Resources
this.partials = new PartialStack();
this.helpers = new HelperStack();
this.addDirectory(Path.basename(theme.basePath), theme.basePath);
this.addDirectory('default', Renderer.getDefaultTheme());
this.addDirectory('theme', theme.basePath);
}