Confirmedusers, editor, Administrators
886
edits
CreativeMD (talk | contribs) No edit summary |
CreativeMD (talk | contribs) No edit summary |
||
Line 114: | Line 114: | ||
item.el.prepend($tail); | item.el.prepend($tail); | ||
}); | }); | ||
// | function updateLines() | ||
{ | |||
//Update height of all items | |||
items.forEach(function (item) { | |||
if (item.parent === undefined) { | |||
return; | |||
} | |||
var childPos = item.el.position(); | |||
var parent = item.parent; | |||
var parentPos = parent.el.position(); | |||
var height = childPos.top - parentPos.top; | |||
item.el.find(".tail").css("height", height); | |||
}); | |||
} | |||
// handle click event | |||
$table.on("click", "div.tt div.content", function (e) { | |||
var $el = $(e.currentTarget).closest(".tt"); | var $el = $(e.currentTarget).closest(".tt"); | ||
var $tr = $el.closest("tr"); | var $tr = $el.closest("tr"); | ||
Line 169: | Line 169: | ||
$("." + $el.attr("data-tt-id")).fadeIn(400, function(){updateLines()}); | $("." + $el.attr("data-tt-id")).fadeIn(400, function(){updateLines()}); | ||
} | } | ||
updateLines(); | |||
}); | |||
$( window ).resize(function() { | |||
updateLines(); | updateLines(); | ||
}); | }); |