Clean GET params in ajax calls

- Use `data` arg of `$.getJSON` for `format` param
- Delete `dictToArray` call on data returned by `SingleResumeStat` class view since this view now returns stats manifest as an array
This commit is contained in:
Aurélien Delobelle 2017-04-02 17:16:05 +02:00
parent 1ee993e1e1
commit df7e935390

View file

@ -42,8 +42,7 @@
$(this).addClass("focus");
// loads data and shows it
$.getJSON(this.stats_target_url + "?format=json",
displayStats);
$.getJSON(this.stats_target_url, {format: 'json'}, displayStats);
}
function displayStats (data) {
@ -158,7 +157,7 @@
"aria-label": "select-period"});
var to_click;
var context = dictToArray(data.stats);
var context = data.stats;
for (var i = 0; i < context.length; i++) {
// creates the button
@ -191,7 +190,7 @@
// constructor
(function () {
$.getJSON(url + "?format=json", initialize);
$.getJSON(url, {format: 'json'}, initialize);
})();
};
})(jQuery);