Merge pull request #35 from davidkennedy85/master

See davidkennedy85/DataTables-Ellipses-Plugin#3
pull/265/head
Allan Jardine 11 years ago
commit 160ba5e5ca

@ -11,17 +11,10 @@
* @anchor ellipses * @anchor ellipses
* @author <a href="http://daveden.wordpress.com/">Dave Kennedy</a> * @author <a href="http://daveden.wordpress.com/">Dave Kennedy</a>
* @example * @example
* $('#my-table').dataTable({ * $(document).ready(function() {
* // Optional usage of extended oSettings object * $('#example').dataTable({
* 'fnInfoCallback': function(oSettings) { * 'sPaginationType': 'ellipses'
* // 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
* 'sPaginationType': 'ellipses'
* }); * });
*/ */
@ -134,7 +127,7 @@ $.fn.dataTableExt.oPagination.ellipses = {
// The reason for moving is so we can access current state info before fnUpdate is called // The reason for moving is so we can access current state info before fnUpdate is called
'fnUpdateState': function(oSettings) { 'fnUpdateState': function(oSettings) {
var iCurrentPage = Math.ceil((oSettings._iDisplayStart + 1) / oSettings._iDisplayLength), 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, iFirstPage = iCurrentPage - oSettings._iShowPagesHalf,
iLastPage = iCurrentPage + oSettings._iShowPagesHalf; iLastPage = iCurrentPage + oSettings._iShowPagesHalf;

Loading…
Cancel
Save