Replaced success() with done ()

This commit is contained in:
James Cole 2016-02-04 07:30:12 +01:00
parent 7343304284
commit fb119cc208
9 changed files with 19 additions and 19 deletions

View File

@ -62,7 +62,7 @@ function updateBudgetedAmounts(e) {
drawBudgetedBar();
// send a post to Firefly to update the amount:
$.post('budgets/amount/' + id, {amount: value, _token: token}).success(function (data) {
$.post('budgets/amount/' + id, {amount: value, _token: token}).done(function (data) {
// update the link if relevant:
if (data.repetition > 0) {
$('.budget-link[data-id="' + id + '"]').attr('href', 'budgets/show/' + id + '/' + data.repetition);

View File

@ -136,7 +136,7 @@ var defaultStackedColumnOptions = {
*/
function lineChart(URL, container, options) {
"use strict";
$.getJSON(URL).success(function (data) {
$.getJSON(URL).done(function (data) {
var ctx = document.getElementById(container).getContext("2d");
var newData = {};
newData.datasets = [];
@ -170,7 +170,7 @@ function lineChart(URL, container, options) {
function areaChart(URL, container, options) {
"use strict";
$.getJSON(URL).success(function (data) {
$.getJSON(URL).done(function (data) {
var ctx = document.getElementById(container).getContext("2d");
var newData = {};
newData.datasets = [];
@ -206,7 +206,7 @@ function columnChart(URL, container, options) {
options = options || {};
$.getJSON(URL).success(function (data) {
$.getJSON(URL).done(function (data) {
var result = true;
if (options.beforeDraw) {
@ -252,7 +252,7 @@ function stackedColumnChart(URL, container, options) {
options = options || {};
$.getJSON(URL).success(function (data) {
$.getJSON(URL).done(function (data) {
var result = true;
if (options.beforeDraw) {
@ -295,7 +295,7 @@ function stackedColumnChart(URL, container, options) {
function pieChart(URL, container, options) {
"use strict";
$.getJSON(URL).success(function (data) {
$.getJSON(URL).done(function (data) {
var ctx = document.getElementById(container).getContext("2d");
new Chart(ctx).Pie(data, defaultPieOptions);

View File

@ -47,7 +47,7 @@ $(function () {
end: end.format('YYYY-MM-DD'),
label: label,
_token: token
}).success(function () {
}).done(function () {
console.log('Succesfully sent new date range.');
window.location.reload(true);
}).fail(function () {

View File

@ -16,7 +16,7 @@ function showHelp(e) {
$('#helpTitle').html('Please hold...');
$('#helpModal').modal('show');
$.getJSON('help/' + encodeURI(route)).success(function (data) {
$.getJSON('help/' + encodeURI(route)).done(function (data) {
$('#helpBody').html(data.text);
$('#helpTitle').html(data.title);
}).fail(function () {

View File

@ -5,7 +5,7 @@ $(function () {
// do chart JS stuff.
drawChart();
if (showTour) {
$.getJSON('json/tour').success(function (data) {
$.getJSON('json/tour').done(function (data) {
var tour = new Tour(
{
steps: data.steps,
@ -70,7 +70,7 @@ function getBoxAmounts() {
var boxes = ['in', 'out', 'bills-unpaid', 'bills-paid'];
for (var x in boxes) {
var box = boxes[x];
$.getJSON('json/box/' + box).success(putData).fail(failData);
$.getJSON('json/box/' + box).done(putData).fail(failData);
}
}

View File

@ -79,7 +79,7 @@ function stopSorting() {
var id = holder.data('id');
order.push(id);
});
$.post('/piggy-banks/sort', {_token: token, order: order}).success(function () {
$.post('/piggy-banks/sort', {_token: token, order: order}).done(function () {
$('.loadSpin').removeClass('fa fa-refresh fa-spin');
});
}

View File

@ -126,7 +126,7 @@ function openModal(e) {
var target = $(e.target).parent();
var URL = target.attr('href');
$.get(URL).success(function (data) {
$.get(URL).done(function (data) {
$('#defaultModal').empty().html(data).modal('show');
}).fail(function () {

View File

@ -20,7 +20,7 @@ function addNewTrigger() {
"use strict";
triggerCount++;
$.getJSON('json/trigger', {count: triggerCount}).success(function (data) {
$.getJSON('json/trigger', {count: triggerCount}).done(function (data) {
//console.log(data.html);
$('tbody.rule-trigger-tbody').append(data.html);
}).fail(function () {
@ -32,7 +32,7 @@ function addNewAction() {
"use strict";
actionCount++;
$.getJSON('json/action', {count: actionCount}).success(function (data) {
$.getJSON('json/action', {count: actionCount}).done(function (data) {
//console.log(data.html);
$('tbody.rule-action-tbody').append(data.html);
}).fail(function () {

View File

@ -9,13 +9,13 @@
$(document).ready(function () {
"use strict";
if ($('input[name="expense_account"]').length > 0) {
$.getJSON('json/expense-accounts').success(function (data) {
$.getJSON('json/expense-accounts').done(function (data) {
$('input[name="expense_account"]').typeahead({source: data});
});
}
if ($('input[name="tags"]').length > 0) {
$.getJSON('json/tags').success(function (data) {
$.getJSON('json/tags').done(function (data) {
var opt = {
typeahead: {
source: data
@ -28,19 +28,19 @@ $(document).ready(function () {
}
if ($('input[name="revenue_account"]').length > 0) {
$.getJSON('json/revenue-accounts').success(function (data) {
$.getJSON('json/revenue-accounts').done(function (data) {
$('input[name="revenue_account"]').typeahead({source: data});
});
}
if ($('input[name="description"]').length > 0 && what !== undefined) {
$.getJSON('json/transaction-journals/' + what).success(function (data) {
$.getJSON('json/transaction-journals/' + what).done(function (data) {
$('input[name="description"]').typeahead({source: data});
});
}
if ($('input[name="category"]').length > 0) {
$.getJSON('json/categories').success(function (data) {
$.getJSON('json/categories').done(function (data) {
$('input[name="category"]').typeahead({source: data});
});
}