MediaWiki:Common.js: Difference between revisions
From Vintage Story Wiki
CreativeMD (talk | contribs) No edit summary |
CreativeMD (talk | contribs) No edit summary |
||
Line 128: | Line 128: | ||
}); | }); | ||
} | } | ||
//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; | |||
var width = item.left - parent.left; | |||
var left = parent.left - item.left + (parent.width / 2); | |||
var $tail = $('<div class="tail"></div>').css({ | |||
height: height, | |||
width: width, | |||
left: left | |||
}); | |||
item.el.prepend($tail); | |||
}); | |||
}); | }); | ||
// initially hide all children | /*// initially hide all children | ||
items.forEach(function (item) { | items.forEach(function (item) { | ||
Line 136: | Line 160: | ||
item.el.find(".content").click(); | item.el.find(".content").click(); | ||
} | } | ||
}); | });*/ | ||
} | } | ||
}); | }); |