do not assume module names have three parts
This commit is contained in:
parent
4666af6288
commit
445767a598
2 changed files with 5 additions and 5 deletions
|
|
@ -77,11 +77,11 @@ exports.moduleUrl = function(name, component) {
|
|||
return options.$moduleUrls[name];
|
||||
|
||||
var parts = name.split("/");
|
||||
component = component || parts[1];
|
||||
var base = parts[2].replace(component, "").replace(/(^[\-_])|([\-_]$)/, "");
|
||||
component = component || parts[parts.length - 2] || "";
|
||||
var base = parts[parts.length - 1].replace(component, "").replace(/(^[\-_])|([\-_]$)/, "");
|
||||
|
||||
if (!base)
|
||||
base = parts[1];
|
||||
if (!base && parts.length > 1)
|
||||
base = parts[parts.length - 2];
|
||||
return this.get(component + "Path") + "/" + component + "-" + base + this.get("suffix");
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue