mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-11 18:21:04 +08:00
22 lines
464 B
JavaScript
22 lines
464 B
JavaScript
var CounterBadge = (function() {
|
|
'use strict';
|
|
|
|
function updateCounterBadge(count, linkedId, type) {
|
|
var badge =
|
|
$('.' + type +
|
|
'-badge-indicator[data-linked-id="' +
|
|
linkedId + '"]').first();
|
|
if (badge.length) {
|
|
badge.text(count);
|
|
if (count > 0) {
|
|
badge.removeClass('hidden');
|
|
} else {
|
|
badge.addClass('hidden');
|
|
}
|
|
}
|
|
}
|
|
|
|
return {
|
|
updateCounterBadge: updateCounterBadge
|
|
};
|
|
})();
|