Merge pull request #35 from davidkennedy85/master

See davidkennedy85/DataTables-Ellipses-Plugin#3
gh-pages
Allan Jardine 11 years ago
commit 160ba5e5ca

@ -11,18 +11,11 @@
* @anchor ellipses
* @author <a href="http://daveden.wordpress.com/">Dave Kennedy</a>
* @example
* $('#my-table').dataTable({
* // Optional usage of extended oSettings object
* 'fnInfoCallback': function(oSettings) {
* // Update stateful properties
* $.fn.dataTableExt.oPagination.ellipses.fnUpdateState(oSettings);
* return 'Viewing page ' + oSettings._iCurrentPage + ' of ' + oSettings._iTotalPages;
* },
* // Optional usage of iShowPages option
* 'iShowPages': 15,
* // This is the only required option
* $(document).ready(function() {
* $('#example').dataTable({
* 'sPaginationType': 'ellipses'
* });
* });
*/
$.extend($.fn.dataTableExt.oStdClasses, {
@ -134,7 +127,7 @@ $.fn.dataTableExt.oPagination.ellipses = {
// The reason for moving is so we can access current state info before fnUpdate is called
'fnUpdateState': function(oSettings) {
var iCurrentPage = Math.ceil((oSettings._iDisplayStart + 1) / oSettings._iDisplayLength),
iTotalPages = Math.ceil(oSettings.fnRecordsTotal() / oSettings._iDisplayLength),
iTotalPages = Math.ceil(oSettings.fnRecordsDisplay() / oSettings._iDisplayLength),
iFirstPage = iCurrentPage - oSettings._iShowPagesHalf,
iLastPage = iCurrentPage + oSettings._iShowPagesHalf;

Loading…
Cancel
Save