Improve sidebar message counter
This commit is contained in:
parent
0f68823298
commit
cabf766fba
|
@ -327,6 +327,7 @@ $(function() {
|
|||
self.addClass("active")
|
||||
.find(".badge")
|
||||
.removeClass("highlight")
|
||||
.data("count", "")
|
||||
.empty();
|
||||
|
||||
if (sidebar.find(".highlight").length == 0) {
|
||||
|
@ -432,8 +433,9 @@ $(function() {
|
|||
|
||||
var badge = btn.find(".badge");
|
||||
if (badge.length !== 0) {
|
||||
var i = (parseInt(badge.html()) || 0) + 1;
|
||||
badge.html(i);
|
||||
var i = (badge.data("count") || 0) + 1;
|
||||
badge.data("count", i);
|
||||
badge.html(i > 999 ? (i / 1000).toFixed(1) + "k" : i);
|
||||
if (highlight || query) {
|
||||
badge.addClass("highlight");
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "shout",
|
||||
"description": "A web IRC client",
|
||||
"version": "0.25.2",
|
||||
"version": "0.25.3",
|
||||
"author": "Mattias Erming",
|
||||
"preferGlobal": true,
|
||||
"bin": {
|
||||
|
|
Loading…
Reference in New Issue