Skip to content

Commit 6cd675f

Browse files
author
Mike Taylor
committed
Issue #372 - updateModelParams should take key, value args.
1 parent 06d6974 commit 6cd675f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

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

+5-3
Original file line numberDiff line numberDiff line change
@@ -393,15 +393,17 @@ issueList.IssueView = Backbone.View.extend({
393393
}
394394
this.fetchAndRenderIssues();
395395
},
396-
updateModelParams: function(data) {
397-
var dataParams = data.params.key + '=' + data.params.value;
396+
updateModelParams: function(paramKey, paramValue) {
398397
var modelUrl = this.issues.url.split('?');
399398
var modelPath = modelUrl[0];
400399
var modelParams = modelUrl[1];
401400

401+
var updateParams = {};
402+
updateParams[paramKey] = paramValue;
403+
402404
// merge old params with passed in param data
403405
// $.extend will update existing object keys, and add new ones
404-
var newParams = $.extend($.deparam(modelParams), $.deparam(dataParams));
406+
var newParams = $.extend($.deparam(modelParams), updateParams);
405407

406408
// construct new model URL and re-request issues
407409
this.issues.url = modelPath + '?' + $.param(newParams);

0 commit comments

Comments
 (0)