X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/74081c8b2e9a8588505c40257556e17274fc80de..41e4e58d2d389558b91565c16b0c7c0ec7c558fa:/redakcja/static/js/button_scripts.js?ds=sidebyside diff --git a/redakcja/static/js/button_scripts.js b/redakcja/static/js/button_scripts.js index 4aa0c95a..06bc7c5b 100644 --- a/redakcja/static/js/button_scripts.js +++ b/redakcja/static/js/button_scripts.js @@ -193,9 +193,9 @@ function ScriptletCenter() if(lcase == text) repl = ucase; /* was lowercase */ else if(ucase != text) repl = lcase; /* neither lower- or upper-case */ else { /* upper case -> camel-case */ - var words = $(lcase.split(/\s/)).map(function() { - if(this.length > 0) { - return this[0].toUpperCase() + this.slice(1); + var words = $.map(lcase.split(/\s/), function(word) { + if(word.length > 0) { + return word[0].toUpperCase() + word.slice(1); } else { return ''; }