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