[ticket/578] Correctly assign classes to element upon deleting modules
B3P-578
This commit is contained in:
@@ -83,16 +83,20 @@ phpbb.addAjaxCallback('b3p_delete_module', function(res) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var el = $(this).parents('tr:first'),
|
var $deletedRow = $(this).parents('tr:first'),
|
||||||
nextEl = el.next();
|
$nextRow = $deletedRow.next();
|
||||||
|
|
||||||
el.remove();
|
$deletedRow.remove();
|
||||||
|
|
||||||
// Fix classes of next elements
|
// Fix classes of next elements
|
||||||
while (nextEl !== undefined && nextEl.is('tr')) {
|
while ($nextRow !== undefined && $nextRow.is('tr')) {
|
||||||
var nextElClass = (nextEl.attr('class') === 'row1') ? 'row2' : 'row1';
|
var nextRowClass = ($nextRow.attr('class') === 'row1') ? 'row2' : 'row1';
|
||||||
nextEl.attr('class', nextElClass);
|
|
||||||
nextEl = nextEl.next();
|
if ($nextRow.attr('class') !== 'row3') {
|
||||||
|
$nextRow.attr('class', nextRowClass);
|
||||||
|
}
|
||||||
|
|
||||||
|
$nextRow = $nextRow.next();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user