Move the mediatag and avatar code outsite of common-ui-elements

This commit is contained in:
yflory
2020-03-30 12:09:12 +02:00
parent 7047abe407
commit 75e5d3cc42
11 changed files with 55 additions and 249 deletions

View File

@@ -7,10 +7,11 @@ define([
'/common/common-hash.js',
'/common/common-util.js',
'/common/common-feedback.js',
'/common/inner/common-mediatag.js',
'/common/hyperscript.js',
'/common/messenger-ui.js',
'/customize/messages.js',
], function ($, Config, ApiConfig, UIElements, UI, Hash, Util, Feedback, h,
], function ($, Config, ApiConfig, UIElements, UI, Hash, Util, Feedback, MT, h,
MessengerUI, Messages) {
var Common;
@@ -345,17 +346,9 @@ MessengerUI, Messages) {
window.open(origin+'/profile/#' + data.profile);
});
}
if (data.avatar && UIElements.getAvatar(data.avatar)) {
$span.append(UIElements.getAvatar(data.avatar));
Common.displayAvatar($span, data.avatar, name, function () {
$span.append($rightCol);
} else {
Common.displayAvatar($span, data.avatar, name, function ($img) {
if (data.avatar && $img && $img.length) {
UIElements.setAvatar(data.avatar, $img[0].outerHTML);
}
$span.append($rightCol);
});
}
});
$span.data('uid', data.uid);
$editUsersList.append($span);
});