From 0c5712411b995dc9504a871693018fd4b876a355 Mon Sep 17 00:00:00 2001 From: pichalite Date: Tue, 26 Jan 2016 21:27:22 +0000 Subject: [PATCH] fix for user icons when searching for users to add to group in acp>manage>group page --- public/src/admin/manage/group.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/public/src/admin/manage/group.js b/public/src/admin/manage/group.js index a98e64831d..99bbbf2958 100644 --- a/public/src/admin/manage/group.js +++ b/public/src/admin/manage/group.js @@ -1,11 +1,12 @@ "use strict"; -/*global define, templates, socket, ajaxify, app, bootbox, translator */ +/*global define, templates, socket, ajaxify, app, bootbox */ define('admin/manage/group', [ 'forum/groups/memberlist', 'iconSelect', - 'admin/modules/colorpicker' -], function(memberList, iconSelect, colorpicker) { + 'admin/modules/colorpicker', + 'translator' +], function(memberList, iconSelect, colorpicker, translator) { var Groups = {}; Groups.init = function() { @@ -56,9 +57,11 @@ define('admin/manage/group', [ 'data-uid': results.users[x].uid, 'data-username': results.users[x].username, 'data-userslug': results.users[x].userslug, - 'data-picture': results.users[x].picture + 'data-picture': results.users[x].picture, + 'data-usericon-bgColor': results.users[x]['icon:bgColor'], + 'data-usericon-text': results.users[x]['icon:text'] }) - .append($('').attr('src', results.users[x].picture)) + .append(results.users[x].picture ? $('').attr('src', results.users[x].picture) : $('
').addClass('user-icon').css('background-color', results.users[x]['icon:bgColor']).html(results.users[x]['icon:text'])) .append($('').html(results.users[x].username)); groupDetailsSearchResults.append(foundUser); @@ -86,7 +89,9 @@ define('admin/manage/group', [ uid: userLabel.attr('data-uid'), username: userLabel.attr('data-username'), userslug: userLabel.attr('data-userslug'), - picture: userLabel.attr('data-picture') + picture: userLabel.attr('data-picture'), + "icon:bgColor": userLabel.attr('data-usericon-bgColor'), + "icon:text": userLabel.attr('data-usericon-text') }; templates.parse('partials/groups/memberlist', 'members', {group: {isOwner: ajaxify.data.group.isOwner, members: [member]}}, function(html) {