FIX: Resolver should try with slashes instead of periods too
This commit is contained in:
parent
f43293a7bc
commit
d9c2b316b6
|
@ -37,11 +37,16 @@ Discourse.Resolver = Ember.DefaultResolver.extend({
|
|||
normalize: function(fullName) {
|
||||
var split = fullName.split(':');
|
||||
if (split.length > 1) {
|
||||
|
||||
// Try slashes
|
||||
var dashed = Ember.String.dasherize(split[1].replace(/\./g, '/')),
|
||||
moduleName = 'discourse/' + split[0] + 's/' + dashed;
|
||||
if (requirejs.entries[moduleName]) {
|
||||
return split[0] + ":" + dashed;
|
||||
}
|
||||
if (requirejs.entries[moduleName]) { return split[0] + ":" + dashed; }
|
||||
|
||||
// Try with dashes instead of slashes
|
||||
dashed = Ember.String.dasherize(split[1].replace(/\./g, '-'));
|
||||
moduleName = 'discourse/' + split[0] + 's/' + dashed;
|
||||
if (requirejs.entries[moduleName]) { return split[0] + ":" + dashed; }
|
||||
}
|
||||
return this._super(fullName);
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue