main
psychobunny 10 years ago
parent 1cf4b261c3
commit 69bc047ea3

@ -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);
}
}

@ -89,6 +89,23 @@
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 {

Loading…
Cancel
Save