From 407a955444da6207f59c5f05d283275510b2169c Mon Sep 17 00:00:00 2001 From: Malibu Date: Mon, 23 Feb 2015 19:40:01 +0100 Subject: [PATCH] modified: SRC/app/Http/routes.php modified: SRC/public/js/ListeOeuvre.js --- SRC/app/Http/routes.php | 2 +- SRC/public/js/ListeOeuvre.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/SRC/app/Http/routes.php b/SRC/app/Http/routes.php index 6927aa9..0a5d503 100644 --- a/SRC/app/Http/routes.php +++ b/SRC/app/Http/routes.php @@ -40,7 +40,7 @@ Route::group(['middleware' => 'auth'], function () Route::post('addListeOeuvre', 'ReferentController@addListeOeuvre'); Route::get('showListOeuvres/{id}', 'ReferentController@showListeOeuvres'); Route::post('setListOeuvres', 'ReferentController@setListOeuvres'); - Route::post('search/', 'ReferentController@search'); + Route::post('search', 'ReferentController@search'); }); Route::group(['middleware' => 'admin'], function () diff --git a/SRC/public/js/ListeOeuvre.js b/SRC/public/js/ListeOeuvre.js index 43accb5..5288376 100644 --- a/SRC/public/js/ListeOeuvre.js +++ b/SRC/public/js/ListeOeuvre.js @@ -61,9 +61,11 @@ $('#search_button, #previous, #next').click(function(event) { event.preventDefault(); + if(this.id == $('#next').attr('id') && $("#next").parent().hasClass('disabled') || this.id == $('#previous').attr('id') && $("#previous").parent().hasClass('disabled')) + return 0; + if (this.id == $('#next').attr('id')) { str = $("#next").attr('href'); - console.log(/([0-9]+)/.exec(str)); url = "/search?page="+/([0-9]+)/.exec(str)[0]; }else if (this.id == $('#previous').attr('id')) { str = $("#previous").attr('href'); @@ -86,7 +88,6 @@ $('#search_button, #previous, #next').click(function(event) { $.post(url, dataSend, function( data ) { - console.log(data); if (data.length == 0 ) $("#oeuvreRes").append("Aucune Oeuvre Trouvé.."); data.data.forEach( function(el) {