diff --git a/app/Repositories/Journal/JournalRepositoryInterface.php b/app/Repositories/Journal/JournalRepositoryInterface.php index 54de77e272..89e15791fb 100644 --- a/app/Repositories/Journal/JournalRepositoryInterface.php +++ b/app/Repositories/Journal/JournalRepositoryInterface.php @@ -21,16 +21,6 @@ interface JournalRepositoryInterface */ public function first(); - /** - * - * Get the account_id, which is the asset account that paid for the transaction. - * - * @param TransactionJournal $journal - * - * @return int - */ - public function getAssetAccount(TransactionJournal $journal); - /** * @param TransactionType $dbType * diff --git a/public/js/piggy-banks.js b/public/js/piggy-banks.js index b9ffc0401c..ebe9a444a8 100644 --- a/public/js/piggy-banks.js +++ b/public/js/piggy-banks.js @@ -10,18 +10,37 @@ $(function () { { helper: fixHelper, stop: stopSorting, - handle: '.handle' + handle: '.handle', + start: function (event, ui) { + // Build a placeholder cell that spans all the cells in the row + var cellCount = 0; + $('td, th', ui.helper).each(function () { + // For each TD or TH try and get it's colspan attribute, and add that or 1 to the total + var colspan = 1; + var colspanAttr = $(this).attr('colspan'); + if (colspanAttr > 1) { + colspan = colspanAttr; + } + cellCount += colspan; + }); + + // Add the placeholder UI - note that this is the item's content, so TD rather than TR + ui.placeholder.html(' '); + } } ); }); // Return a helper with preserved width of cells -var fixHelper = function (e, ui) { - ui.children().each(function () { - $(this).width($(this).width()); +var fixHelper = function(e, tr) { + 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 addMoney(e) { var pigID = parseInt($(e.target).data('id')); diff --git a/resources/views/list/piggy-banks.blade.php b/resources/views/list/piggy-banks.blade.php index 279bd70494..3b6f366261 100644 --- a/resources/views/list/piggy-banks.blade.php +++ b/resources/views/list/piggy-banks.blade.php @@ -6,7 +6,7 @@ - +