diff --git a/js/wn/views/doclistview.js b/js/wn/views/doclistview.js index 638554ceeb..891a8f1fff 100644 --- a/js/wn/views/doclistview.js +++ b/js/wn/views/doclistview.js @@ -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) { + $('') + .click(function() { + me.reload_stats(); + }).appendTo($('
') + .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() {