Fix user count

Still dirty, but really works.
pull/2257/head
0ip 2014-10-05 13:14:07 +02:00
parent 4569e91592
commit 5008ad10c6
2 changed files with 6 additions and 11 deletions

View File

@ -166,9 +166,10 @@ li[data-key=showusers] > a {
} }
li[data-key=showusers] > a #online_count { li[data-key=showusers] > a #online_count {
color: #777; color: #777;
font-size: 10px; font-size: 11px;
position: relative; position: relative;
top: 2px; top: 2px;
padding-left: 2px;
} }
#editorcontainer { #editorcontainer {
position: absolute; position: absolute;
@ -736,9 +737,6 @@ table#otheruserstable {
opacity: 0.01; opacity: 0.01;
display: none; display: none;
} }
#online_count {
color: #888;
}
.rtl { .rtl {
direction: RTL direction: RTL
} }

View File

@ -468,6 +468,8 @@ var paduserlist = (function()
self.setMyUserInfo(myInitialUserInfo); self.setMyUserInfo(myInitialUserInfo);
$('#editbar [data-key=showusers] > a').append('<span id="online_count">1</span>');
$("#otheruserstable tr").remove(); $("#otheruserstable tr").remove();
if (pad.getUserIsGuest()) if (pad.getUserIsGuest())
@ -602,13 +604,8 @@ var paduserlist = (function()
online++; online++;
} }
} }
var $btn = $("#editbar [data-key=showusers] > a")
, $counter = $('#online_count', $btn) $('#online_count').text(online);
if(!$counter.length) {
$counter = $('<span id="online_count">')
$btn.append($counter)
}
$counter.text(online);
return online; return online;
}, },