cleanup
This commit is contained in:
parent
6b25845660
commit
6b5eb8bf39
1 changed files with 16 additions and 17 deletions
|
@ -2,14 +2,16 @@
|
|||
|
||||
oml.ui.peersButton = function() {
|
||||
|
||||
var that = Ox.Element({
|
||||
tooltip: Ox._('No peering requests')
|
||||
})
|
||||
.css({
|
||||
marginRight: '6px'
|
||||
}),
|
||||
count,
|
||||
requests = 0;
|
||||
var requests = 0,
|
||||
|
||||
that = Ox.Element({
|
||||
tooltip: Ox._('No peering requests')
|
||||
})
|
||||
.css({
|
||||
marginRight: '6px'
|
||||
}),
|
||||
|
||||
$count;
|
||||
|
||||
Ox.Button({
|
||||
style: 'symbol',
|
||||
|
@ -27,7 +29,7 @@ oml.ui.peersButton = function() {
|
|||
})
|
||||
.appendTo(that);
|
||||
|
||||
count = Ox.Element()
|
||||
$count = Ox.Element()
|
||||
.addClass('OxLight')
|
||||
.css({
|
||||
float: 'left',
|
||||
|
@ -47,21 +49,18 @@ oml.ui.peersButton = function() {
|
|||
});
|
||||
update();
|
||||
|
||||
function open() {
|
||||
|
||||
}
|
||||
function update() {
|
||||
// wait for clearCache in folder.js
|
||||
setTimeout(function() {
|
||||
oml.api.getUsers(function(result) {
|
||||
requests = result.data.users.filter(function(user) {
|
||||
return user.pending=="received";
|
||||
return user.pending == 'received';
|
||||
}).length;
|
||||
count.html(requests);
|
||||
$count.html(requests);
|
||||
that.options({
|
||||
tooltip: Ox._(requests
|
||||
? Ox.formatCount(requests, 'peering request')
|
||||
: 'No peering requests')
|
||||
tooltip: requests
|
||||
? Ox.formatCount(requests, '{0} peering request')
|
||||
: Ox._('No peering requests')
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue