refresh stats in doclist
This commit is contained in:
parent
e6178b44fd
commit
3164e2f28b
1 changed files with 14 additions and 6 deletions
|
|
@ -210,12 +210,16 @@ wn.views.DocListView = wn.ui.Listing.extend({
|
|||
$.each(me.listview.stats, function(i, v) {
|
||||
me.render_stat(v, r.message[v]);
|
||||
});
|
||||
|
||||
// This doesn't give a predictable stats order
|
||||
/*
|
||||
$.each(r.message, function(field, stat) {
|
||||
me.render_stat(field, stat);
|
||||
});*/
|
||||
|
||||
// reload button at the end
|
||||
if(me.listview.stats.length) {
|
||||
$('<button class="btn btn-small"><i class="refresh"></i> Refresh</button>')
|
||||
.click(function() {
|
||||
me.reload_stats();
|
||||
}).appendTo($('<div class="stat-wrapper">')
|
||||
.appendTo(me.$page.find('.layout-side-section')))
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
@ -275,6 +279,10 @@ wn.views.DocListView = wn.ui.Listing.extend({
|
|||
this.setup_stat_item_click($item);
|
||||
return $item;
|
||||
},
|
||||
reload_stats: function() {
|
||||
this.$page.find('.layout-side-section .stat-wrapper').remove();
|
||||
this.init_stats();
|
||||
},
|
||||
setup_stat_item_click: function($item) {
|
||||
var me = this;
|
||||
$item.find('a').click(function() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue