From acaccea977f1331f5ca0324f8c93ed45423fea36 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Tue, 3 May 2016 12:47:16 +0200 Subject: [PATCH] Allow pagination widget to handle empty pages --- js/h5p-data-view.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/js/h5p-data-view.js b/js/h5p-data-view.js index 860625f..0edfc56 100644 --- a/js/h5p-data-view.js +++ b/js/h5p-data-view.js @@ -108,11 +108,11 @@ var H5PDataView = (function ($) { else { // Update table data self.updateTable(data.rows); - - // Update pagination widget - self.updatePagination(data.num); } + // Update pagination widget + self.updatePagination(data.num); + if (self.loaded !== undefined) { self.loaded(); } @@ -255,7 +255,6 @@ var H5PDataView = (function ($) { var remove = function () { self.facets[col].$tag.remove(); delete self.facets[col]; - self.offset = 0; // Reset to page 1 self.loadData(); }; @@ -276,9 +275,6 @@ var H5PDataView = (function ($) { } }); - // Reset to page 1 - self.offset = 0; - // Load data with new filter self.loadData(); };