Commit c09a89c7 authored by Phil Hughes's avatar Phil Hughes

Converted branch_graph.js to axios

parent b5b30446
/* eslint-disable func-names, space-before-function-paren, no-var, wrap-iife, quotes, comma-dangle, one-var, one-var-declaration-per-line, no-mixed-operators, no-loop-func, no-floating-decimal, consistent-return, no-unused-vars, prefer-template, prefer-arrow-callback, camelcase, max-len */ /* eslint-disable func-names, space-before-function-paren, no-var, wrap-iife, quotes, comma-dangle, one-var, one-var-declaration-per-line, no-mixed-operators, no-loop-func, no-floating-decimal, consistent-return, no-unused-vars, prefer-template, prefer-arrow-callback, camelcase, max-len */
import { __ } from '../locale';
import axios from '../lib/utils/axios_utils';
import flash from '../flash';
import Raphael from './raphael'; import Raphael from './raphael';
export default (function() { export default (function() {
...@@ -26,16 +29,13 @@ export default (function() { ...@@ -26,16 +29,13 @@ export default (function() {
} }
BranchGraph.prototype.load = function() { BranchGraph.prototype.load = function() {
return $.ajax({ axios.get(this.options.url)
url: this.options.url, .then(({ data }) => {
method: "get",
dataType: "json",
success: $.proxy(function(data) {
$(".loading", this.element).hide(); $(".loading", this.element).hide();
this.prepareData(data.days, data.commits); this.prepareData(data.days, data.commits);
return this.buildGraph(); this.buildGraph();
}, this) })
}); .catch(() => __('Error fetching network graph.'));
}; };
BranchGraph.prototype.prepareData = function(days, commits) { BranchGraph.prototype.prepareData = function(days, commits) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment