Confirmedusers, editor, Administrators
886
edits
CreativeMD (talk | contribs) No edit summary |
CreativeMD (talk | contribs) No edit summary |
||
Line 28: | Line 28: | ||
el: $el, | el: $el, | ||
left: 0, | left: 0, | ||
width: $el.width() + 12 | width: $el.width() + 12 | ||
}; | }; | ||
Line 62: | Line 61: | ||
items.forEach(function (item) { | items.forEach(function (item) { | ||
item.el.html('<div class="content">' + item.el.html() + '</div>'); | item.el.html('<div class="content">' + item.el.html() + '</div>'); | ||
}); | |||
// add parent classes | |||
items.forEach(function (item) { | |||
if (item.children.length > 0) { | |||
item.el.addClass("tt-parent"); | |||
item.showChildren = true; | |||
var className = item.el.attr("data-tt-id"); | |||
//item.el.closest("tr").addClass(className); | |||
var children = item.children.slice(); | |||
while(children.length > 0) | |||
{ | |||
children[0].el.closest("tr").addClass(className); | |||
if(children[0].children.length > 0) | |||
children.push.apply(children[0], children[0].children); | |||
children.shift(); | |||
} | |||
//$("." + className).wrapAll("<span id='children_group_" + item.el.attr("data-tt-id") + "'></col>"); | |||
} | |||
}); | }); | ||
Line 85: | Line 107: | ||
}); | }); | ||
item.el.prepend($tail); | item.el.prepend($tail); | ||
}); | }); | ||
Line 138: | Line 135: | ||
hide(id);*/ | hide(id);*/ | ||
$("." + $el.attr("data-tt-id")). | $("." + $el.attr("data-tt-id")).hide(); | ||
} | } | ||
else { | else { | ||
Line 146: | Line 143: | ||
$(child.el).closest("tr").removeClass("tt-hide"); | $(child.el).closest("tr").removeClass("tt-hide"); | ||
});*/ | });*/ | ||
$("." + $el.attr("data-tt-id")). | $("." + $el.attr("data-tt-id")).show(); | ||
} | } | ||