summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-03-16 12:59:46 (GMT)
committerAleksander Machniak <alec@alec.pl>2012-03-16 12:59:46 (GMT)
commit312fc2521b6a2a1097c877af755e4974ae26bc92 (patch)
tree4b7468d4fa2c3dc15727bd56fa6055036a591032
parent5c8910981fd49e389e668e29b30f92abd6c64b12 (diff)
downloadkolab-wap-312fc2521b6a2a1097c877af755e4974ae26bc92.tar.gz
Support maxlength in listelement widget
-rw-r--r--lib/kolab_client_task.php4
-rw-r--r--public_html/skins/default/ui.js5
2 files changed, 7 insertions, 2 deletions
diff --git a/lib/kolab_client_task.php b/lib/kolab_client_task.php
index 4e1c90c..bd49cd3 100644
--- a/lib/kolab_client_task.php
+++ b/lib/kolab_client_task.php
@@ -614,6 +614,10 @@ class kolab_client_task
case 'list':
$result['type'] = kolab_form::INPUT_TEXTAREA;
$result['data-type'] = kolab_form::TYPE_LIST;
+
+ if (!empty($field['maxlength'])) {
+ $result['data-maxlength'] = $field['maxlength'];
+ }
break;
default:
diff --git a/public_html/skins/default/ui.js b/public_html/skins/default/ui.js
index 546c1dc..5645f7e 100644
--- a/public_html/skins/default/ui.js
+++ b/public_html/skins/default/ui.js
@@ -199,7 +199,8 @@ function form_element_wrapper(form_element)
elem = form_list_element(form_element.form, {
name: form_element.name+'['+i+']',
value: list[i],
- disabled: disabled
+ disabled: disabled,
+ maxlength: e.attr('data-maxlength')
});
elem.appendTo(area);
}
@@ -217,7 +218,7 @@ function form_list_element(form, data)
+ '<span title="" class="add"></span><span title="" class="reset"></span>'
+ '</span><input></span>');
- $('input', elem).attr({name: data.name, value: data.value, disabled: data.disabled});
+ $('input', elem).attr(data);
if (data.disabled)
return elem;