From 0e14fbd0f8932dc3842498574f5b6595fc85c7b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kadir=20Do=C4=9Fan?= Date: Fri, 18 Jan 2013 00:51:56 +0200 Subject: [PATCH] Update jquery.SimpleMaxChars.js fixed commas --- jquery.SimpleMaxChars.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/jquery.SimpleMaxChars.js b/jquery.SimpleMaxChars.js index 24baced..a3c93df 100644 --- a/jquery.SimpleMaxChars.js +++ b/jquery.SimpleMaxChars.js @@ -86,11 +86,12 @@ // Can be overwritten with your own message function if you want. Example: $.fn.SimpleMaxChars.message = function( chars, opts, maxLength ) { doMyStuff; return myStuff; } ); $.fn.SimpleMaxChars.message = function( chars, opts, maxLength ) { - var remainingChars = maxLength - chars; - lineBreak = ""; - html = ""; + var remainingChars = maxLength - chars, + lineBreak = "", + html = "", messageClass = opts.messageClass, - remainingMessage = opts.remainingMessage.replace('__remaining_chars__', remainingChars) + remainingMessage = opts.remainingMessage.replace('__remaining_chars__', remainingChars); + if ( opts.lineBreak === true ) { lineBreak = '
'; }