1
0
mirror of https://github.com/DataTables/DataTables.git synced 2025-02-27 00:54:15 +01:00

Dev fix: API page.info().page should use 0 as the start index not 1

- Math.floor should be used to have page indexes starting at 0 rather
  than 1, since page(n) uses 0 based indexing.
This commit is contained in:
Allan Jardine 2013-08-20 15:01:17 +01:00
parent e1f4a8fa9e
commit 425eb38c5b
2 changed files with 3 additions and 3 deletions

View File

@ -1 +1 @@
0d53fc629f28fb20a1434aa66826684eaeedaf57
ad25f79e7614164e30d030d7bcc295ccd8833f7c

View File

@ -31,7 +31,7 @@
// Define as an AMD module if possible
if ( typeof define === 'function' && define.amd )
{
define( 'datatables', ['jquery'], factory );
define( ['jquery'], factory );
}
/* Define using browser globals otherwise
* Prevent multiple instantiations if the script is loaded twice
@ -6773,7 +6773,7 @@
all = len === -1;
return {
"page": all ? 0 : Math.ceil( start / len ),
"page": all ? 0 : Math.floor( start / len ),
"pages": all ? 1 : Math.ceil( visRecords / len ),
"start": start,
"end": settings.fnDisplayEnd(),