From 598a1dcbbcba5f19862a57e6ec695293756e2cee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bonkowski?= Date: Fri, 1 Oct 2010 16:29:25 +0200 Subject: [PATCH] added support for configuring size and maxlength --- jquery.jeditable.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/jquery.jeditable.js b/jquery.jeditable.js index eb8a911..e2600c9 100644 --- a/jquery.jeditable.js +++ b/jquery.jeditable.js @@ -48,7 +48,9 @@ * @param String options[select] true or false, when true text is highlighted ?? * @param String options[placeholder] Placeholder text or html to insert when element is empty. ** * @param String options[onblur] 'cancel', 'submit', 'ignore' or function ?? - * + * @param String options[size] the size of the text field + * @param String options[maxlength] the maximum number of character in the text field + * * @param Function options[onsubmit] function(settings, original) { ... } called before submit * @param Function options[onreset] function(settings, original) { ... } called before reset * @param Function options[onerror] function(settings, original, xhr) { ... } called on error @@ -457,6 +459,14 @@ /* https://bugzilla.mozilla.org/show_bug.cgi?id=236791 */ //input[0].setAttribute('autocomplete','off'); input.attr('autocomplete','off'); + if (settings.size) { + input.attr('size', settings.size); + } + + if (settings.maxlength) { + input.attr('maxlength', settings.maxlength); + } + $(this).append(input); return(input); }