Skip to content
This repository has been archived by the owner on Jul 29, 2022. It is now read-only.

Commit

Permalink
Add label settings. by @tomasm- (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasCARPi committed Dec 19, 2017
1 parent 32dc835 commit 97a1686
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions demos/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ <h4 class='card-title'>Character counter</h4>
$(".editable-text").editable("save.php", {
indicator : "<img src='img/indicator.gif' />",
type : "text",
label : "This is a label",
submit : 'OK',
tooltip : "Click to edit..."
});
Expand Down
6 changes: 6 additions & 0 deletions src/jquery.jeditable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -195,6 +196,11 @@
}
}

// add a label if it exists
if (settings.label) {
form.append("<label>" + settings.label + "</label>");
}

/* Add main input element to form and store it in input. */
var input = element.apply(form, [settings, self]);

Expand Down

0 comments on commit 97a1686

Please sign in to comment.