From d04a06a9b7966b84258a9a8d2ae06148eedb8264 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Fri, 6 Aug 2010 12:20:35 +0200 Subject: [PATCH] Fixes #752, lower- to titlecase bug --- redakcja/static/js/button_scripts.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 ''; } -- 2.20.1