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 | |
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')
-rw-r--r-- | views/default/css.php | 6 | ||||
-rw-r--r-- | views/default/input/userpicker.php | 18 |
2 files changed, 12 insertions, 12 deletions
diff --git a/views/default/css.php b/views/default/css.php index d61d5a6c4..4d6c9e2a5 100644 --- a/views/default/css.php +++ b/views/default/css.php @@ -2593,6 +2593,10 @@ a.delete_report_button:hover { width:300px; } +.ac_results strong { + font-weight: bold; +} + .user_picker .user_picker_entry { clear: both; padding: 1em; @@ -2601,4 +2605,4 @@ a.delete_report_button:hover { .livesearch_icon { float: left; padding-right: 1em; -}
\ No newline at end of file +} 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) { |