|
|
|
@ -49,6 +49,20 @@ $(document).ready(function() {
|
|
|
|
|
if (data.module === 'composer') {
|
|
|
|
|
data.options.icon = 'fa-plus';
|
|
|
|
|
} else if (data.module === 'chat') {
|
|
|
|
|
if (!data.element.length) {
|
|
|
|
|
createChatIcon(data);
|
|
|
|
|
$(window).one('action:taskbar.pushed', function(ev, data) {
|
|
|
|
|
updateChatCount(data.element);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
} else if (!data.element.hasClass('active')) {
|
|
|
|
|
updateChatCount(data.element);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function createChatIcon(data) {
|
|
|
|
|
data.options.icon = 'fa-spinner fa-spin';
|
|
|
|
|
|
|
|
|
|
$.getJSON(config.relative_path + '/api/user/' + utils.slugify(data.options.title), function(user) {
|
|
|
|
@ -58,7 +72,10 @@ $(document).ready(function() {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
function updateChatCount(el) {
|
|
|
|
|
var count = (parseInt($(el).attr('data-content'), 10) || 0) + 1;
|
|
|
|
|
$(el).attr('data-content', count);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|