MediaWiki:Common.js: Difference between revisions

From Vintage Story Wiki
no edit summary
No edit summary
No edit summary
Line 69: Line 69:
item.showChildren = true;
item.showChildren = true;
}
}
if(item.parent != undefined)
item.el.addClass(item.parent.attr("data-tt-id"));
});
});


Line 107: Line 110:
item.showChildren = false;
item.showChildren = false;


function hide(parentId) {
/*function hide(parentId) {
var item = index[parentId];
var item = index[parentId];
item.children.forEach(function (child) {
item.children.forEach(function (child) {
Line 119: Line 122:
}
}


hide(id);
hide(id);*/
$("." + $el.attr("data-tt-id")).hide();
}
}
else {
else {
// show direct children
// show direct children
item.showChildren = true;
/*item.showChildren = true;
item.children.forEach(function (child) {
item.children.forEach(function (child) {
$(child.el).closest("tr").removeClass("tt-hide");
$(child.el).closest("tr").removeClass("tt-hide");
});
});*/
$("." + $el.attr("data-tt-id")).show();
}
}


                        //Update height of all items
//Update height of all items
                        items.forEach(function (item) {
items.forEach(function (item) {
 
if (item.parent === undefined) {
if (item.parent === undefined) {
return;
return;
Line 142: Line 147:
var height = childPos.top - parentPos.top;
var height = childPos.top - parentPos.top;
/*var $tail = $('<div class="tail"></div>').css({
item.el.find(".tail").css("height", height);
height: 1
                                });*/
//item.el.prepend($tail);
                                item.el.find(".tail").css("height", height);
});
});
});
});
Confirmedusers, editor, Administrators
886

edits