main
psychobunny 10 years ago
parent 1cf4b261c3
commit 69bc047ea3

@ -49,16 +49,33 @@ $(document).ready(function() {
if (data.module === 'composer') { if (data.module === 'composer') {
data.options.icon = 'fa-plus'; data.options.icon = 'fa-plus';
} else if (data.module === 'chat') { } else if (data.module === 'chat') {
data.options.icon = 'fa-spinner fa-spin'; if (!data.element.length) {
createChatIcon(data);
$.getJSON(config.relative_path + '/api/user/' + utils.slugify(data.options.title), function(user) { $(window).one('action:taskbar.pushed', function(ev, data) {
var el = $('#taskbar [data-uuid="' + data.uuid + '"] a'); updateChatCount(data.element);
el.find('i').remove(); });
el.css('background-image', 'url(' + user.picture + ')');
}); } 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) {
var el = $('#taskbar [data-uuid="' + data.uuid + '"] a');
el.find('i').remove();
el.css('background-image', 'url(' + user.picture + ')');
});
}
function updateChatCount(el) {
var count = (parseInt($(el).attr('data-content'), 10) || 0) + 1;
$(el).attr('data-content', count);
}
} }

@ -89,6 +89,23 @@
color: @gray; color: @gray;
} }
} }
&.new:after {
content: attr(data-content);
position: absolute;
left: 52px;
top: 0px;
font-size: 10px;
text-align: center;
border: 1px solid #890405;
color: #fff;
font-weight: bold;
min-width: 20px;
.border-radius(4px);
background: #c91106;
padding: 1px 2px;
font-family: @font-family-sans-serif;
}
} }
&.taskbar-composer, &.taskbar-chat { &.taskbar-composer, &.taskbar-chat {

Loading…
Cancel
Save