Skip to content

Commit cc12da8

Browse files
author
Mike Taylor
committed
Issue #372 - pagination should use updateModelparams.
This will likely change once Links are followed.
1 parent 6cd675f commit cc12da8

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

webcompat/static/js/lib/issue-list.js

+6-8
Original file line numberDiff line numberDiff line change
@@ -351,23 +351,21 @@ issueList.IssueView = Backbone.View.extend({
351351
e.preventDefault();
352352
},
353353
requestNextPage: function() {
354-
var newUrl;
355354
if (this.issues.getNextPageNumber()) {
356355
// chop off the last character, which is the page number
357356
// TODO: this feels gross. ideally we should get the URL from the
358357
// link header and send that to an API endpoint which then requests
359358
// it from GitHub.
360-
newUrl = this.issues.url.slice(0,-1) + this.issues.getNextPageNumber();
361-
this.issues.url = newUrl;
362-
this.fetchAndRenderIssues();
359+
//TODO fix, this won't work. slice approach is bogus.
360+
//need to deparam, update, re-param.
361+
//maybe extend update model params to take key, value?
362+
//updateModelParams("page", this.issues.getNextPageNumber());
363+
this.updateModelParams("page", this.issues.getNextPageNumber());
363364
}
364365
},
365366
requestPreviousPage: function() {
366-
var newUrl;
367367
if (this.issues.getPreviousPageNumber()) {
368-
newUrl = this.issues.url.slice(0,-1) + this.issues.getPreviousPageNumber();
369-
this.issues.url = newUrl;
370-
this.fetchAndRenderIssues();
368+
this.updateModelParams("page", this.issues.getPreviousPageNumber());
371369
}
372370
},
373371
updateIssues: function(category) {

0 commit comments

Comments
 (0)