From 78f131c0514bc99f73b9c063fac3158ab2e51e17 Mon Sep 17 00:00:00 2001 From: blackst0ne Date: Sat, 3 Jun 2017 12:40:20 +1100 Subject: Fix duplication of commits header on commits page --- app/assets/javascripts/pager.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'app/assets/javascripts/pager.js') diff --git a/app/assets/javascripts/pager.js b/app/assets/javascripts/pager.js index 0ef20af9260..01110420cca 100644 --- a/app/assets/javascripts/pager.js +++ b/app/assets/javascripts/pager.js @@ -6,11 +6,12 @@ import '~/lib/utils/url_utility'; const ENDLESS_SCROLL_FIRE_DELAY_MS = 1000; const Pager = { - init(limit = 0, preload = false, disable = false, callback = $.noop) { + init(limit = 0, preload = false, disable = false, prepareData = $.noop, callback = $.noop) { this.url = $('.content_list').data('href') || gl.utils.removeParams(['limit', 'offset']); this.limit = limit; this.offset = parseInt(gl.utils.getParameterByName('offset'), 10) || this.limit; this.disable = disable; + this.prepareData = prepareData; this.callback = callback; this.loading = $('.loading').first(); if (preload) { @@ -29,7 +30,7 @@ import '~/lib/utils/url_utility'; dataType: 'json', error: () => this.loading.hide(), success: (data) => { - this.append(data.count, data.html); + this.append(data.count, this.prepareData(data.html)); this.callback(); // keep loading until we've filled the viewport height -- cgit v1.2.1