From c6042a905374d453539cd171c92f787bcefad453 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 1 Mar 2015 19:47:42 +0100 Subject: [PATCH] Try to fix modal dialog for piggy banks. --- app/Http/routes.php | 4 ++-- public/js/piggy-banks.js | 4 ++-- resources/views/piggy-banks/add.blade.php | 9 ++++++--- resources/views/piggy-banks/index.blade.php | 7 +++++-- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/app/Http/routes.php b/app/Http/routes.php index 84ee9dd19c..f05ad4625e 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -255,8 +255,8 @@ Route::group( * Piggy Bank Controller */ Route::get('/piggy-banks', ['uses' => 'PiggyBankController@index', 'as' => 'piggy-banks.index']); - Route::get('/piggy-banks/add/{piggyBank}', ['uses' => 'PiggyBankController@add']); # add money - Route::get('/piggy-banks/remove/{piggyBank}', ['uses' => 'PiggyBankController@remove']); #remove money + Route::get('/piggy-banks/add/{piggyBank}', ['uses' => 'PiggyBankController@add','as' => 'piggy-banks.addMoney']); # add money + Route::get('/piggy-banks/remove/{piggyBank}', ['uses' => 'PiggyBankController@remove','as' => 'piggy-banks.removeMoney']); #remove money Route::get('/piggy-banks/create', ['uses' => 'PiggyBankController@create', 'as' => 'piggy-banks.create']); Route::get('/piggy-banks/edit/{piggyBank}', ['uses' => 'PiggyBankController@edit', 'as' => 'piggy-banks.edit']); Route::get('/piggy-banks/delete/{piggyBank}', ['uses' => 'PiggyBankController@delete', 'as' => 'piggy-banks.delete']); diff --git a/public/js/piggy-banks.js b/public/js/piggy-banks.js index 0b603306cd..c6cdac3c94 100644 --- a/public/js/piggy-banks.js +++ b/public/js/piggy-banks.js @@ -9,14 +9,14 @@ $(function () { function addMoney(e) { var pigID = parseInt($(e.target).data('id')); - $('#moneyManagementModal').empty().load('piggy-banks/add/' + pigID).modal('show'); + $('#moneyManagementModal').empty().load('piggy-banks/add/' + pigID, function() {$('#moneyManagementModal').modal('show');}); return false; } function removeMoney(e) { var pigID = parseInt($(e.target).data('id')); - $('#moneyManagementModal').empty().load('piggy-banks/remove/' + pigID).modal('show'); + $('#moneyManagementModal').empty().load('piggy-banks/remove/' + pigID, function() {$('#moneyManagementModal').modal('show');}); return false; } \ No newline at end of file diff --git a/resources/views/piggy-banks/add.blade.php b/resources/views/piggy-banks/add.blade.php index 94c46696b3..37ae0ff02e 100644 --- a/resources/views/piggy-banks/add.blade.php +++ b/resources/views/piggy-banks/add.blade.php @@ -1,17 +1,19 @@ -
-{!! Form::token() !!} +
- + diff --git a/resources/views/piggy-banks/index.blade.php b/resources/views/piggy-banks/index.blade.php index aaba316735..6457513596 100644 --- a/resources/views/piggy-banks/index.blade.php +++ b/resources/views/piggy-banks/index.blade.php @@ -36,9 +36,9 @@
@if($piggyBank->leftToSave > 0) - + @endif - +
@@ -124,6 +124,9 @@ @stop