Permalink
Browse files

Edit address using textarea

  • Loading branch information...
1 parent cbe16c5 commit 8105f631093643e4b43396cd0a0228be29099153 @jimwins committed Oct 28, 2012
Showing with 14 additions and 3 deletions.
  1. +14 −3 person.php
View
@@ -100,7 +100,7 @@ function loadPerson(person) {
</tr>
<tr>
<th>Address:</th>
- <td id="address" class="editable"></td>
+ <td id="address" class="editable_multi"></td>
</tr>
<tr>
<th>Tax ID:</th>
@@ -115,7 +115,8 @@ function loadPerson(person) {
</tr>
</table>
<script>
-$('#person .editable').editable(function(value, settings) {
+var edit_person=
+function(value, settings) {
var person= $('#person').data('person');
var data= { person: person.id };
var key= this.id;
@@ -131,10 +132,20 @@ function (data) {
loadPerson(data.person);
});
return "...";
-}, {
+}
+$('#person .editable').editable(edit_person,
+{
+ event: 'dblclick',
+ style: 'display: inline',
+ placeholder: '',
+});
+$('#person .editable_multi').editable(edit_person,
+{
+ type: 'textarea',
event: 'dblclick',
style: 'display: inline',
placeholder: '',
+ submit: 'OK',
});
$('#person #active').on('dblclick', function(ev) {
ev.preventDefault();

0 comments on commit 8105f63

Please sign in to comment.