mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
57 lines
1.6 KiB
JavaScript
Vendored
57 lines
1.6 KiB
JavaScript
Vendored
/*
|
|
* all.js
|
|
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
|
*
|
|
* This file is part of Firefly III.
|
|
*
|
|
* Firefly III is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* Firefly III is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
function loadAjaxPartial(holder, uri) {
|
|
"use strict";
|
|
$.get(uri).done(function (data) {
|
|
displayAjaxPartial(data, holder);
|
|
}).fail(function () {
|
|
failAjaxPartial(uri, holder);
|
|
});
|
|
}
|
|
|
|
function failAjaxPartial(uri, holder) {
|
|
"use strict";
|
|
var holderObject = $('#' + holder);
|
|
holderObject.parent().find('.overlay').remove();
|
|
holderObject.addClass('general-chart-error');
|
|
|
|
}
|
|
|
|
function displayAjaxPartial(data, holder) {
|
|
"use strict";
|
|
var obj = $('#' + holder);
|
|
obj.html(data);
|
|
obj.parent().find('.overlay').remove();
|
|
|
|
// call some often needed recalculations and what-not:
|
|
|
|
// find a sortable table and make it sortable:
|
|
if (typeof $.bootstrapSortable === "function") {
|
|
$.bootstrapSortable(true);
|
|
}
|
|
|
|
// find the info click things and respond to them:
|
|
triggerInfoClick();
|
|
|
|
// trigger list thing
|
|
listLengthInitial();
|
|
|
|
} |