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

parent a1891654
...@@ -15,7 +15,8 @@ $(document).ready(function () { ...@@ -15,7 +15,8 @@ $(document).ready(function () {
}; };
// Разворачиваем каждую ветку до того уровня где есть own-проценты: // Разворачиваем каждую ветку до того уровня где есть own-проценты:
ShowOwnPercents(); //ShowOwnPercents();
ShowFirstLevel();
function ShowOwnPercents() function ShowOwnPercents()
{ {
...@@ -61,6 +62,21 @@ $(document).ready(function () { ...@@ -61,6 +62,21 @@ $(document).ready(function () {
} }
function ShowFirstLevel()
{
var
$wrap = $tableCats,
$allTrs = $('tr.feed-cat', $wrap),
$groupAllTrs = $('.group', $allTrs),
$mainTrs = $('tr.feed-cat[data-parent="0"]', $wrap);
$wrap.addClass('open');
$groupAllTrs.removeClass('open');
$allTrs.removeClass('open');
$mainTrs.addClass('open');
}
// Свернуть-развернуть список категорий фида: // Свернуть-развернуть список категорий фида:
$('.cat-title-main', $tableCats).on('click', function(e) { $('.cat-title-main', $tableCats).on('click', function(e) {
......
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