Skip to content

Commit

Permalink
Issue #373 - fetchAndRenderIssues now constructs the model url.
Browse files Browse the repository at this point in the history
With an option to pass it the entire thing, rather than composing
from model path and params properties. This is used when following
Link header URIs.
  • Loading branch information
Mike Taylor committed Dec 10, 2014
1 parent 49e2e13 commit f6bbc7b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions webcompat/static/js/lib/issue-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,13 @@ issueList.IssueView = Backbone.View.extend({
this.fetchAndRenderIssues();
}
},
fetchAndRenderIssues: function() {
//assumes this.issues.url has already been set to something meaninful.
fetchAndRenderIssues: function(options) {
var headers = {headers: {'Accept': 'application/json'}};
if (options && options.url) {
this.issues.url = options.url;
} else {
this.issues.url = this.issues.path + '?' + $.param(this.issues.params);
}
this.issues.fetch(headers).success(_.bind(function() {
this.render(this.issues);
this.initPaginationLinks(this.issues);
Expand Down

0 comments on commit f6bbc7b

Please sign in to comment.