@@ -351,23 +351,21 @@ issueList.IssueView = Backbone.View.extend({
351
351
e . preventDefault ( ) ;
352
352
} ,
353
353
requestNextPage : function ( ) {
354
- var newUrl ;
355
354
if ( this . issues . getNextPageNumber ( ) ) {
356
355
// chop off the last character, which is the page number
357
356
// TODO: this feels gross. ideally we should get the URL from the
358
357
// link header and send that to an API endpoint which then requests
359
358
// 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 ( ) ) ;
363
364
}
364
365
} ,
365
366
requestPreviousPage : function ( ) {
366
- var newUrl ;
367
367
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 ( ) ) ;
371
369
}
372
370
} ,
373
371
updateIssues : function ( category ) {
0 commit comments