mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
I noticed a weird page jump in the piggy bank section so it seemed a good moment to clean up some javascript.
This commit is contained in:
parent
b044d85e90
commit
c38e4b86b4
7
public/js/lib/jquery-ui.min.js
vendored
Normal file
7
public/js/lib/jquery-ui.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -1,12 +1,23 @@
|
||||
/*
|
||||
* index.js
|
||||
* Copyright (C) 2016 Sander Dorigo
|
||||
*
|
||||
* This software may be modified and distributed under the terms
|
||||
* of the MIT license. See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
/* globals $, lineChart, token, piggyBankID */
|
||||
|
||||
// Return a helper with preserved width of cells
|
||||
var fixHelper = function (e, ui) {
|
||||
var fixHelper = function (e, tr) {
|
||||
"use strict";
|
||||
ui.children().each(function () {
|
||||
$(this).width($(this).width());
|
||||
var $originals = tr.children();
|
||||
var $helper = tr.clone();
|
||||
$helper.children().each(function (index) {
|
||||
// Set helper cell sizes to match the original sizes
|
||||
$(this).width($originals.eq(index).width());
|
||||
});
|
||||
return ui;
|
||||
return $helper;
|
||||
};
|
||||
|
||||
$(function () {
|
||||
@ -14,10 +25,6 @@ $(function () {
|
||||
$('.addMoney').on('click', addMoney);
|
||||
$('.removeMoney').on('click', removeMoney);
|
||||
|
||||
if (typeof(lineChart) === 'function' && typeof(piggyBankID) !== 'undefined') {
|
||||
lineChart('chart/piggy-bank/' + piggyBankID, 'piggy-bank-history');
|
||||
}
|
||||
|
||||
$('#sortable tbody').sortable(
|
||||
{
|
||||
helper: fixHelper,
|
16
public/js/piggy-banks/show.js
Normal file
16
public/js/piggy-banks/show.js
Normal file
@ -0,0 +1,16 @@
|
||||
/*
|
||||
* show.js
|
||||
* Copyright (C) 2016 Sander Dorigo
|
||||
*
|
||||
* This software may be modified and distributed under the terms
|
||||
* of the MIT license. See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
/* globals $, lineChart, piggyBankID */
|
||||
|
||||
$(function () {
|
||||
"use strict";
|
||||
if (typeof(lineChart) === 'function' && typeof(piggyBankID) !== 'undefined') {
|
||||
lineChart('chart/piggy-bank/' + piggyBankID, 'piggy-bank-history');
|
||||
}
|
||||
});
|
@ -41,7 +41,7 @@
|
||||
<tbody>
|
||||
{% for id,info in accounts %}
|
||||
<tr>
|
||||
<td><a href="{{ route('accounts.show',id) }}">{{ info.name }}</a></td>
|
||||
<td><a href="{{ route('accounts.show',id) }}" title="{{ info.name }}">{{ info.name }}</a></td>
|
||||
<td class="hidden-sm hidden-xs">{{ info.balance|formatAmount }}</td>
|
||||
<td>{{ info.leftForPiggyBanks|formatAmount }}</td>
|
||||
<td class="hidden-sm hidden-xs">{{ info.sumOfTargets|formatAmount }}</td>
|
||||
@ -57,6 +57,6 @@
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block scripts %}
|
||||
<script src="js/jquery-ui.min.js" type="text/javascript"></script>
|
||||
<script type="text/javascript" src="js/piggy-banks.js"></script>
|
||||
<script src="js/lib/jquery-ui.min.js" type="text/javascript"></script>
|
||||
<script type="text/javascript" src="js/piggy-banks/index.js"></script>
|
||||
{% endblock %}
|
||||
|
@ -94,5 +94,5 @@
|
||||
|
||||
<script type="text/javascript" src="js/Chart.min.js"></script>
|
||||
<script type="text/javascript" src="js/charts.js"></script>
|
||||
<script type="text/javascript" src="js/piggy-banks.js"></script>
|
||||
<script type="text/javascript" src="js/piggy-banks/show.js"></script>
|
||||
{% endblock %}
|
||||
|
Loading…
Reference in New Issue
Block a user