Fallback to default theme resources (#252)
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user