Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Commit

Permalink
Fix edge cases for classnames (no namespace)
Browse files Browse the repository at this point in the history
  • Loading branch information
nabcos committed Apr 8, 2013
1 parent b826164 commit 979a64f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
14 changes: 8 additions & 6 deletions nexus-webapp/src/main/webapp/js/NX/base.js
Expand Up @@ -46,12 +46,14 @@ define('NX/base', ['require'], function(require) {
*/
obj: function (path) {
var context = NX.global;
Ext.each(path.split('.'), function (part) {
context = context[part];
if (context === undefined) {
throw new Error('No object at path: ' + path + '; part is undefined: ' + part);
}
});
if (typeof path === 'string') {
Ext.each(path.split('.'), function (part) {
context = context[part];
if (context === undefined) {
throw new Error('No object at path: ' + path + '; part is undefined: ' + part);
}
});
}
return context;
},

Expand Down
4 changes: 3 additions & 1 deletion nexus-webapp/src/main/webapp/js/lib/string.js
Expand Up @@ -35,7 +35,9 @@ Ext.applyIf(String.prototype, {
intIndexOfMatch = strText.indexOf(strTarget);
}

return (strText);
// return new String, because returning "this" here without a #replace inbetween returns a char array,
// not a String (seen in chrome).
return String(strText);
}
});

Expand Down

0 comments on commit 979a64f

Please sign in to comment.