mirror of
https://github.com/DataTables/DataTables.git
synced 2025-01-30 23:52:11 +01:00
Same thing for two button pagination control
This commit is contained in:
parent
ba02adc6e9
commit
4b1b4626a5
31
media/js/jquery.dataTables.js
vendored
31
media/js/jquery.dataTables.js
vendored
@ -286,6 +286,13 @@
|
|||||||
*/
|
*/
|
||||||
"fnInit": function ( oSettings, nPaging, fnCallbackDraw )
|
"fnInit": function ( oSettings, nPaging, fnCallbackDraw )
|
||||||
{
|
{
|
||||||
|
function fnClickHandler ( e ) {
|
||||||
|
if ( oSettings.oApi._fnPageChange( oSettings, e.data.action ) )
|
||||||
|
{
|
||||||
|
fnCallbackDraw( oSettings );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var nPrevious, nNext, nPreviousInner, nNextInner;
|
var nPrevious, nNext, nPreviousInner, nNextInner;
|
||||||
|
|
||||||
/* Store the next and previous elements in the oSettings object as they can be very
|
/* Store the next and previous elements in the oSettings object as they can be very
|
||||||
@ -319,24 +326,12 @@
|
|||||||
nPaging.appendChild( nPrevious );
|
nPaging.appendChild( nPrevious );
|
||||||
nPaging.appendChild( nNext );
|
nPaging.appendChild( nNext );
|
||||||
|
|
||||||
$(nPrevious).bind( 'click.DT', function() {
|
$(nPrevious)
|
||||||
if ( oSettings.oApi._fnPageChange( oSettings, "previous" ) )
|
.bind( 'click.DT', { action: "previous" }, fnClickHandler )
|
||||||
{
|
.bind( 'selectstart.DT', function () { return false; } ); /* Take the brutal approach to cancelling text selection */
|
||||||
/* Only draw when the page has actually changed */
|
$(nNext)
|
||||||
fnCallbackDraw( oSettings );
|
.bind( 'click.DT', { action: "next" }, fnClickHandler )
|
||||||
}
|
.bind( 'selectstart.DT', function () { return false; } ); /* Take the brutal approach to cancelling text selection */
|
||||||
} );
|
|
||||||
|
|
||||||
$(nNext).bind( 'click.DT', function() {
|
|
||||||
if ( oSettings.oApi._fnPageChange( oSettings, "next" ) )
|
|
||||||
{
|
|
||||||
fnCallbackDraw( oSettings );
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
|
|
||||||
/* Take the brutal approach to cancelling text selection */
|
|
||||||
$(nPrevious).bind( 'selectstart.DT', function () { return false; } );
|
|
||||||
$(nNext).bind( 'selectstart.DT', function () { return false; } );
|
|
||||||
|
|
||||||
/* ID the first elements only */
|
/* ID the first elements only */
|
||||||
if ( oSettings.sTableId !== '' && typeof oSettings.aanFeatures.p == "undefined" )
|
if ( oSettings.sTableId !== '' && typeof oSettings.aanFeatures.p == "undefined" )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user