diff --git a/CHANGELOG.md b/CHANGELOG.md index d3b1212..cf0cca2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ * Remove async: false (#135) * Fix issue with width/height (#137) * Fix issue with selected in select element (#106) +* Add label settings. by @tomasm- (#40) ## 1.7.3 diff --git a/demos/index.html b/demos/index.html index 5a09a36..1c44178 100644 --- a/demos/index.html +++ b/demos/index.html @@ -144,6 +144,7 @@

Character counter

$(".editable-text").editable("save.php", { indicator : "", type : "text", + label : "This is a label", submit : 'OK', tooltip : "Click to edit..." }); diff --git a/src/jquery.jeditable.js b/src/jquery.jeditable.js index 3a393c3..e798eb3 100644 --- a/src/jquery.jeditable.js +++ b/src/jquery.jeditable.js @@ -48,6 +48,7 @@ * @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 String options[label] optional label * * @param Function options[onsubmit] function(settings, original) { ... } called before submit * @param Function options[onreset] function(settings, original) { ... } called before reset @@ -195,6 +196,11 @@ } } + // add a label if it exists + if (settings.label) { + form.append(""); + } + /* Add main input element to form and store it in input. */ var input = element.apply(form, [settings, self]);