diff options
Diffstat (limited to 'public/js/app.js')
-rw-r--r-- | public/js/app.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/public/js/app.js b/public/js/app.js index 2a7cf08bae..23b629e3e1 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -303,6 +303,9 @@ var Gogits = {}; // api working Gogits.getUsers = function (val, $target) { + var notEmpty = function (str) { + return str && str.length > 0; + } $.ajax({ url: '/api/v1/users/search?q=' + val, dataType: "json", @@ -310,7 +313,11 @@ var Gogits = {}; if (json.ok && json.data.length) { var html = ''; $.each(json.data, function (i, item) { - html += '<li><img src="' + item.avatar + '">' + item.username + '</li>'; + html += '<li><img src="' + item.avatar + '">' + item.username; + if (notEmpty(item.full_name)) { + html += ' (' + item.full_name + ')'; + } + html += '</li>'; }); $target.toggleShow(); $target.find('ul').html(html); |