2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-07 12:02:53 +08:00

Don't try injecting into the Resolver. Use options instead.

This commit is contained in:
Robin Ward 2016-11-03 14:15:26 -04:00
parent c8282e4ca1
commit e18ae34493
3 changed files with 14 additions and 7 deletions

View file

@ -9,6 +9,13 @@ var LOADING_WHITELIST = ['badges', 'userActivity', 'userPrivateMessages', 'admin
var _dummyRoute;
var _loadingView;
const _options = {};
export function setResolverOption(name, value) {
_options[name] = value;
}
function loadingResolver(cb) {
return function(parsedName) {
var fullNameWithoutType = parsedName.fullNameWithoutType;
@ -158,14 +165,14 @@ export function buildResolver(baseName) {
},
findPluginMobileTemplate(parsedName) {
if (this.mobileView) {
if (_options.mobileView) {
var pluginParsedName = this.parseName(parsedName.fullName.replace("template:", "template:javascripts/mobile/"));
return this.findTemplate(pluginParsedName);
}
},
findMobileTemplate(parsedName) {
if (this.mobileView) {
if (_options.mobileView) {
var mobileParsedName = this.parseName(parsedName.fullName.replace("template:", "template:mobile/"));
return this.findTemplate(mobileParsedName);
}