mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°2192 fix freeze when lots of lines in a table with selectable lines
Many thanks to Jeffrey Bostoen (@jbostoen) for the bug report !
This commit is contained in:
@@ -285,9 +285,9 @@ function sprintf(format, etc) {
|
||||
}
|
||||
});
|
||||
|
||||
$(table).find(':checkbox[name^=selectObj]').change(function() {
|
||||
$(table).find(':checkbox[name^=selectObj]').on("change init-selection", function () {
|
||||
storeSelection(table, table.config.container, this.value, this.checked, this.disabled);
|
||||
}).trigger("change");
|
||||
}).trigger("init-selection"); // don't need to trigger the very generic change event !
|
||||
}
|
||||
else if (table.config.select_mode == 'single')
|
||||
{
|
||||
|
||||
@@ -59,8 +59,14 @@ $(document).ready(function () {
|
||||
$lineClickedInput.click();
|
||||
});
|
||||
|
||||
$(document).on('change', TABLE_SELECTOR+':has('+LINE_WITH_INPUT_IN_FIRST_CELL_SELECTOR+')', function (event) {
|
||||
$(document).on('change', 'table.listResults', function (event) {
|
||||
var $eventTarget = $(event.target);
|
||||
if (!$eventTarget.has(LINE_WITH_INPUT_IN_FIRST_CELL_SELECTOR))
|
||||
// Originally we had :has in the handler selector but performances were very bad :(
|
||||
// Filtering directly in JQuery is far much quicker ! => N°2192
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (!$eventTarget.is(INPUT_SELECTOR)) {
|
||||
return;
|
||||
}
|
||||
@@ -105,8 +111,9 @@ $(document).ready(function () {
|
||||
function updateLines($inputChanged) {
|
||||
var $selectedLine = $inputChanged.closest("tr");
|
||||
|
||||
if ($inputChanged.is('input:radio')) {
|
||||
// didn't find a proper event fired when radio is deselected... so doing this !
|
||||
// didn't find a proper event fired when radio is deselected... so doing this !
|
||||
if ($inputChanged.is('input:radio'))
|
||||
{
|
||||
$selectedLine
|
||||
.closest('table')
|
||||
.find('tr')
|
||||
|
||||
Reference in New Issue
Block a user