Правка в логике разворачивания категорий по значениям в LS

parent 17440fc8
...@@ -77,10 +77,16 @@ $(document).ready(function () { ...@@ -77,10 +77,16 @@ $(document).ready(function () {
// Разворачиваем категории по стостоянию в localStorage: // Разворачиваем категории по стостоянию в localStorage:
function ShowTableStateByCats(catsState) function ShowTableStateByCats(catsState)
{ {
var $trTitle; var $tr, $groupTr, $inheritedTr;
catsState.forEach(function(id){ catsState.forEach(function(id){
$trTitle = $('tbody tr[data-id="' + id + '"] .cat-title', $tableCats); $tr = $('tbody tr[data-id="' + id + '"]', $tableCats);
$trTitle.click(); $groupTr = $('.group', $tr);
$inheritedTr = $('tbody tr[data-parent="' + id + '"]', $tableCats);
$tr.addClass('open');
$groupTr.addClass('open');
$inheritedTr.addClass('open');
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment