From d9c2b316b6419cdbdc96e824f2f93336991c91da Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Wed, 16 Jul 2014 17:34:48 -0400 Subject: [PATCH] FIX: Resolver should try with slashes instead of periods too --- app/assets/javascripts/discourse/ember/resolver.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/discourse/ember/resolver.js b/app/assets/javascripts/discourse/ember/resolver.js index 5e7eec5831c..4f9a25d6e6f 100644 --- a/app/assets/javascripts/discourse/ember/resolver.js +++ b/app/assets/javascripts/discourse/ember/resolver.js @@ -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); },