MediaWiki:Common.js: Difference between revisions

From Vintage Story Wiki
no edit summary
No edit summary
No edit summary
Line 215: Line 215:
item.left = 0;
item.left = 0;
if (item.parent !== undefined) {
if (item.parent !== undefined) {
                 item.left = item.parent.left + item.parent.width;
                 item.left = item.parent.left + Math.min(item.level > 1 ? 30 : 60, item.parent.width);
}
}
});
});
Line 279: Line 279:
var parentPos = parent.el.position();
var parentPos = parent.el.position();
var height = childPos.top - parentPos.top;
var height = childPos.top - parentPos.top;
var width = item.left - parent.left - parent.width/2;
var parentConnectionPosX = Math.min(item.level > 1 ? 15 : 30, parent.width/2);
var left = parent.left - item.left + (parent.width / 2);
var width = item.left - parent.left - parentConnectionPosX;
var left = parent.left - item.left + (parentConnectionPosX);


var $tail = $('<div class="tail"></div>').css({
var $tail = $('<div class="tail"></div>').css({
Line 341: Line 342:
if(item.children.length > 0) {
if(item.children.length > 0) {
if (item.el.attr("data-hide") == "true" || (item.parent != undefined && item.el.attr("data-hide") != "false")) {
if (item.el.attr("data-hide") == "true" || (item.parent != undefined && item.el.attr("data-hide") != "false")) {
                     if (window.location.hash != "#" + item.el.attr("data-tt-id")) {
                     if (window.location.hash != "#" + item.el.attr("data-tt-id") && (item.parent != undefined && window.location.hash != "#" + item.parent.el.attr("data-tt-id"))) {
item.opened = false;
item.opened = false;
//item.el.hide();
//item.el.hide();
Confirmedusers, editor, Administrators
886

edits