From 466e81d56ae046eb41920a5ccce6f1547fd2e86e Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 25 Sep 2015 20:25:22 +0200 Subject: [PATCH] Fixed some sorting. --- public/js/accounts.js | 4 ++++ public/js/piggy-banks.js | 11 ++++------- resources/twig/list/journals.twig | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/public/js/accounts.js b/public/js/accounts.js index 7d390f74f5..14f5054583 100644 --- a/public/js/accounts.js +++ b/public/js/accounts.js @@ -13,6 +13,7 @@ var fixHelper = function (e, ui) { $(function () { "use strict"; if (typeof(lineChart) === "function" && typeof accountID !== 'undefined') { + lineChart('chart/account/' + accountID, 'overview-chart'); } @@ -26,6 +27,8 @@ $(function () { handle: '.handle' } ).disableSelection(); + } else { + console.log('its null'); } }); @@ -34,6 +37,7 @@ $(function () { function sortStop(event, ui) { "use strict"; var current = $(ui.item); + console.log('sort stop'); var thisDate = current.data('date'); var originalBG = current.css('backgroundColor'); diff --git a/public/js/piggy-banks.js b/public/js/piggy-banks.js index 36c14e20bc..4b8aa3ab6b 100644 --- a/public/js/piggy-banks.js +++ b/public/js/piggy-banks.js @@ -1,15 +1,12 @@ /* globals $, lineChart, token, piggyBankID */ // Return a helper with preserved width of cells -var fixHelper = function (e, tr) { +var fixHelper = function (e, ui) { "use strict"; - 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()); + ui.children().each(function () { + $(this).width($(this).width()); }); - return $helper; + return ui; }; $(function () { diff --git a/resources/twig/list/journals.twig b/resources/twig/list/journals.twig index aa739484bb..f3cae8d9ca 100644 --- a/resources/twig/list/journals.twig +++ b/resources/twig/list/journals.twig @@ -1,6 +1,6 @@ {{ journals.render|raw }} - +