1
0
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:
Allan Jardine 2010-09-03 08:39:16 +01:00
parent bd992cb10a
commit 5f5e6a6f60

View File

@ -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 )