diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-09-07 20:36:11 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-09-07 20:36:11 +0000 |
commit | aa7d8b102bb6c5fdd5534d703f87a1453e52d64e (patch) | |
tree | 924bccce8e36bf6dc547139c70c9cc4a86efe0b0 /views/default/input/userpicker.php | |
parent | 2992d8477c1a14084214c2cd1244561a08bc3ef4 (diff) | |
download | elgg-aa7d8b102bb6c5fdd5534d703f87a1453e52d64e.tar.gz elgg-aa7d8b102bb6c5fdd5534d703f87a1453e52d64e.tar.bz2 |
Added bolding to term searc in user picker.
git-svn-id: https://code.elgg.org/elgg/trunk@3477 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/input/userpicker.php')
-rw-r--r-- | views/default/input/userpicker.php | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/views/default/input/userpicker.php b/views/default/input/userpicker.php index 8f26b8916..b69d295f0 100644 --- a/views/default/input/userpicker.php +++ b/views/default/input/userpicker.php @@ -66,14 +66,7 @@ function userPickerBindAutocomplete(e) { formatItem: userPickerFormatItem, formatResult: function (row, i, max) { eval("var info = " + row + ";"); - //console.log('format result'); - // upon select, adding the user to the user basket. - // this is slightly abusive for this function. - // set it to the hidden input name - - //userPickerAddUser(info.guid); - - // returning the name + // returning the just name return info.name; } }); @@ -85,18 +78,21 @@ function userPickerBindAutocomplete(e) { function userPickerFormatItem(row, i, max, term) { eval("var info = " + row + ";"); var r = ''; + var name = info.name.replace(new RegExp("(" + term + ")", "gi"), "<span class=\"user_picker_highlight\">$1</b>"); + var desc = info.desc.replace(new RegExp("(" + term + ")", "gi"), "<span class=\"user_picker_highlight\">$1</b>"); switch (info.type) { case 'user': case 'group': - r = info.icon + info.name + ' - ' + info.desc; + r = info.icon + name + ' - ' + desc; break; default: - r = info.name + ' - ' + info.desc; + r = name + ' - ' + desc; break; } - return r.replace(new RegExp("(" + term + ")", "gi"), "<b>$1</b>"); + return r; + //return r.replace(new RegExp("(" + term + ")", "gi"), "<span class=\"user_picker_highlight\">$1</b>"); } function userPickerAddUser(event, data, formatted) { |