From 60bc760f60d1c37c1357e79c21b8e95356908415 Mon Sep 17 00:00:00 2001 From: Roman Chyla Date: Fri, 21 Aug 2015 15:54:20 -0400 Subject: [PATCH] Fixed 'pagination that diappeared' --- src/js/widgets/list_of_things/widget.js | 5 +++-- test/mocha/js/widgets/results_render_widget.spec.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/js/widgets/list_of_things/widget.js b/src/js/widgets/list_of_things/widget.js index feeee00e2..209488e26 100644 --- a/src/js/widgets/list_of_things/widget.js +++ b/src/js/widgets/list_of_things/widget.js @@ -54,7 +54,8 @@ define([ perPage: 20, numFound: undefined, currentQuery: undefined, - start: 0 + start: 0, + pageData: undefined }; options.pagination = _.defaults(options.pagination || {}, defaultPagination); @@ -298,7 +299,7 @@ define([ reset: function() { this.collection.reset(); this.hiddenCollection.reset(); - this.model.clear(this.model.defaults()) + this.model.set(this.model.defaults()); } }); diff --git a/test/mocha/js/widgets/results_render_widget.spec.js b/test/mocha/js/widgets/results_render_widget.spec.js index 927e376ef..c77714c3c 100644 --- a/test/mocha/js/widgets/results_render_widget.spec.js +++ b/test/mocha/js/widgets/results_render_widget.spec.js @@ -298,7 +298,7 @@ define([ responseWithoutHighlights.setApiQuery(new ApiQuery()); widget.reset(); - expect(widget.model.get('showHighlights')).to.be.undefined; + expect(widget.model.get('showHighlights')).to.be.false; widget.processResponse(responseWithoutHighlights); expect(widget.model.get('showHighlights')).to.be.false;