Merge pull request #1718 from lkubik/capitalizeAllLetters

KEYCLOAK-1945
This commit is contained in:
Stian Thorgersen 2015-10-14 06:53:24 +02:00
commit d9211d6bc9

View file

@ -2030,16 +2030,11 @@ module.filter('capitalize', function() {
if (!input) { if (!input) {
return; return;
} }
var result = input.substring(0, 1).toUpperCase(); var splittedWords = input.split(/\s+/);
var s = input.substring(1); for (var i=0; i<splittedWords.length ; i++) {
for (var i=0; i<s.length ; i++) { splittedWords[i] = splittedWords[i].charAt(0).toUpperCase() + splittedWords[i].slice(1);
var c = s[i];
if (c.match(/[A-Z]/)) {
result = result.concat(" ")
}; };
result = result.concat(c); return splittedWords.join(" ");
};
return result;
}; };
}); });