summaryrefslogtreecommitdiff
path: root/public_html/js
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2012-04-11 09:37:30 (GMT)
committerAleksander Machniak <machniak@kolabsys.com>2012-04-11 09:37:30 (GMT)
commitbb72cd7199b6cec13b8fe9a1959323c70bdd1bf2 (patch)
tree1e5086c8d29cbcce66cb8deaeea55de546f46316 /public_html/js
parentd6853272627f962ffae248dca683b26a84d05aeb (diff)
downloadkolab-wap-bb72cd7199b6cec13b8fe9a1959323c70bdd1bf2.tar.gz
Add object_type and type_id arguments to list_options/select_options calls (#698)
Diffstat (limited to 'public_html/js')
-rw-r--r--public_html/js/kolab_admin.js17
1 files changed, 12 insertions, 5 deletions
diff --git a/public_html/js/kolab_admin.js b/public_html/js/kolab_admin.js
index 36b749f..b4ed605 100644
--- a/public_html/js/kolab_admin.js
+++ b/public_html/js/kolab_admin.js
@@ -734,6 +734,7 @@ function kolab_admin()
this.form_element_wrapper = function(form_element)
{
var i = 0, j = 0, list = [], elem, e = $(form_element),
+ form = form_element.form,
disabled = e.attr('disabled'),
readonly = e.attr('readonly'),
autocomplete = e.attr('data-autocomplete'),
@@ -760,7 +761,7 @@ function kolab_admin()
// add simple input rows
$.each(list, function(i, v) {
- elem = $('<input>');
+ var elem = $('<input>');
elem.attr({
value: v,
disabled: disabled,
@@ -775,21 +776,27 @@ function kolab_admin()
else {
// add autocompletion input
if (autocomplete) {
- elem = this.form_list_element(form_element.form, {
+ elem = this.form_list_element(form, {
maxlength: maxlength,
autocomplete: autocomplete,
element: e
}, -1);
- elem.appendTo(area);
- this.ac_init(elem, {attribute: form_element.name, oninsert: this.form_element_oninsert});
+ // Initialize autocompletion
+ var props = {attribute: form_element.name, oninsert: this.form_element_oninsert};
+ if (i = $('input[name="type_id"]', form).val())
+ props.type_id = i;
+ if (i = $('input[name="object_type"]', form).val())
+ props.object_type = i;
+ this.ac_init(elem, props);
+ elem.appendTo(area);
area.addClass('autocomplete');
}
// add input rows
$.each(list, function(i, v) {
- elem = kadm.form_list_element(form_element.form, {
+ var elem = kadm.form_list_element(form, {
value: v,
key: i,
maxlength: maxlength,