From 03939698858aa977633b15e309eec6ce64e99027 Mon Sep 17 00:00:00 2001 From: Anderezekial Date: Tue, 2 Sep 2014 12:44:20 -0700 Subject: [PATCH] Update input.js I was off by one with my checks for disabling the buttons. It was changing the page number before I did the check, not after. --- pagination/input.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pagination/input.js b/pagination/input.js index f2562c1..57c44da 100644 --- a/pagination/input.js +++ b/pagination/input.js @@ -73,7 +73,7 @@ $.fn.dataTableExt.oPagination.input = { $(nPrevious).click( function() { oSettings.oApi._fnPageChange( oSettings, "previous" ); fnCallbackDraw( oSettings ); - if ($(nInput).val() == 2) + if ($(nInput).val() == 1) { $(nFirst).addClass('disabled'); $(nPrevious).addClass('disabled'); @@ -88,7 +88,7 @@ $.fn.dataTableExt.oPagination.input = { $(nNext).click( function() { oSettings.oApi._fnPageChange( oSettings, "next" ); fnCallbackDraw( oSettings ); - if ($(nInput).val() == (Math.ceil((oSettings.fnRecordsDisplay() - 1) / oSettings._iDisplayLength) - 1)) + if ($(nInput).val() == (Math.ceil((oSettings.fnRecordsDisplay() - 1) / oSettings._iDisplayLength))) { $(nNext).addClass('disabled'); $(nLast).addClass('disabled');