mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
Makes filter keep focus when hiding/showing sticky
The filter doesn't change the focused element when showing or hiding the sticky header. This fixes it.
This commit is contained in:
parent
6a32e5acc2
commit
22335d67a0
@ -206,6 +206,18 @@
|
||||
.addClass( state )
|
||||
.css(cssSettings);
|
||||
}
|
||||
if (isVisible !== laststate) {
|
||||
// make sure the focused filter stay focused after showing/hiding sticky
|
||||
var $td = $(document.activeElement).closest('td'),
|
||||
column = $td.parent().children().index($td);
|
||||
if (column >= 0 && c.$filters) {
|
||||
if (isVisible === "hidden") {
|
||||
c.$filters.eq(column).find('a, select, input').focus();
|
||||
} else {
|
||||
$stickyTable.find('a, select, input').eq(column).focus();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isVisible !== laststate || resizing) {
|
||||
// make sure the column widths match
|
||||
resizeHeader();
|
||||
|
Loading…
Reference in New Issue
Block a user