Mergess TraditionRules with TextRules. Added tabs for other Text. Some bugs persist see readme

This commit is contained in:
Simon Martens
2022-11-26 23:15:42 +01:00
parent 49c32dcc6a
commit 6370b70e35
21 changed files with 420 additions and 789 deletions

View File

@@ -133,11 +133,11 @@ const overlappingcollapsebox = function (selector, hoverfunction) {
const marginalboxwidthset = function () {
let lt = document.getElementById("ha-letterbody");
if (lt !== null) {
let mg = lt.querySelectorAll(".ha-lettertext .ha-marginalbox");
let mg = lt.querySelectorAll(".ha-text .ha-marginalbox");
if (mg.length > 0) {
let ltbcr = lt.getBoundingClientRect();
let mgbcr = mg[0].getBoundingClientRect();
let nw = ltbcr.right - mgbcr.left - 18;
let nw = ltbcr.right - mgbcr.left - 20;
for (let element of mg) {
element.style.width = nw + "px";
@@ -152,14 +152,14 @@ const collapseboxes = function () {
overlappingcollapsebox(".ha-neuzeit .ha-letlinks", true);
overlappingcollapsebox(".ha-forschung .ha-letlinks", true);
overlappingcollapsebox(".ha-commentlist .ha-letlinks", true);
overlappingcollapsebox(".ha-lettertext .ha-marginalbox", true);
overlappingcollapsebox(".ha-text .ha-marginalbox", true);
};
marginalboxwidthset();
collapseboxes();
var doit;
this.window.addEventListener("resize", function () {
this.clearTimeout(doit);
marginalboxwidthset();
doit = this.setTimeout(collapseboxes, 250);
});
// var doit;
// this.window.addEventListener("resize", function () {
// this.clearTimeout(doit);
// marginalboxwidthset();
// doit = this.setTimeout(collapseboxes, 250);
// });