mirror of
https://github.com/DataTables/DataTables.git
synced 2025-03-15 16:29:16 +01:00
Fixed: DataTables would unnecessarily add mousedown and selectstart event handlers to TH elements which aren't used for sorting. This is used on sorting columns to prevent text selection when clicking the element to perform sorting.
This commit is contained in:
parent
bd992cb10a
commit
5f5e6a6f60
12
media/js/jquery.dataTables.js
vendored
12
media/js/jquery.dataTables.js
vendored
@ -2790,12 +2790,6 @@
|
||||
if ( oSettings.aoColumns[i].bSortable !== false )
|
||||
{
|
||||
_fnSortAttachListener( oSettings, oSettings.aoColumns[i].nTh, i );
|
||||
}
|
||||
else
|
||||
{
|
||||
$(oSettings.aoColumns[i].nTh).addClass( oSettings.oClasses.sSortableNone );
|
||||
}
|
||||
}
|
||||
|
||||
/* Take the brutal approach to cancelling text selection in header */
|
||||
$('th', oSettings.nTHead).mousedown( function (e) {
|
||||
@ -2803,6 +2797,12 @@
|
||||
return false;
|
||||
} );
|
||||
}
|
||||
else
|
||||
{
|
||||
$(oSettings.aoColumns[i].nTh).addClass( oSettings.oClasses.sSortableNone );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Cache the footer elements */
|
||||
if ( oSettings.nTFoot !== null )
|
||||
|
Loading…
x
Reference in New Issue
Block a user