mirror of
https://github.com/Theodor-Springmann-Stiftung/hamann-ausgabe-core.git
synced 2025-10-29 01:05:32 +00:00
Bugfixes (Resize observer)
This commit is contained in:
@@ -122,13 +122,15 @@ public class Briefecontroller : Controller {
|
||||
}
|
||||
|
||||
internal static BriefeMetaViewModel GenerateMetaViewModel(ILibrary lib, Meta meta) {
|
||||
var hasText = lib.Letters.ContainsKey(meta.Index) ? true : false;
|
||||
var hasMarginals = lib.MarginalsByLetter.Contains(meta.Index) ? true : false;
|
||||
var senders = meta.Senders.Select(x => lib.Persons[x].Name) ?? new List<string>();
|
||||
var recivers = meta.Receivers.Select(x => lib.Persons[x].Name) ?? new List<string>();
|
||||
var zhstring = meta.ZH != null ? HaWeb.HTMLHelpers.LetterHelpers.CreateZHString(meta) : null;
|
||||
return new BriefeMetaViewModel(meta, hasMarginals) {
|
||||
ParsedZHString = zhstring,
|
||||
SenderReceiver = generateSendersRecievers(senders, recivers)
|
||||
SenderReceiver = generateSendersRecievers(senders, recivers),
|
||||
HasText = hasText,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ public class XMLRootDocument {
|
||||
filename += hash + "_";
|
||||
}
|
||||
if (!String.IsNullOrWhiteSpace(IdentificationString.Item2)) filename += _removeInvalidChars(IdentificationString.Item2) + "_";
|
||||
filename += _removeInvalidChars(Date.Year.ToString() + "-" + Date.Month.ToString() + "-" + Date.Day.ToString());
|
||||
filename += _removeInvalidChars(Date.Year.ToString() + "-" + Date.Month.ToString() + "-" + Date.Day.ToString()) + "." + Path.GetRandomFileName();
|
||||
return filename + ".xml";
|
||||
}
|
||||
|
||||
|
||||
@@ -88,7 +88,8 @@ Liste für Janina/Luca:
|
||||
tabellen ok, ausser 939
|
||||
|
||||
KOmmentare verschobem 202 Anhang
|
||||
458 leeren lettertext löschen
|
||||
935 leeren lettertext löschen
|
||||
|
||||
Evtl finetuning von note
|
||||
Evtl finetuning von note
|
||||
|
||||
- Text auf der Startseite
|
||||
- Stellenkommentare in extra Tab
|
||||
@@ -13,13 +13,23 @@
|
||||
<div class="ha-letterheader">
|
||||
@await Html.PartialAsync("/Views/Shared/_LetterHead.cshtml", (Model.MetaData, true, false))
|
||||
<div class="ha-letterheadernav">
|
||||
<div class="ha-lettertabs">
|
||||
<div class="md:hidden grow">
|
||||
<select id="ha-switchlettercategory">
|
||||
@foreach (var app in Model.Texts) {
|
||||
@if (app.Category != Model.DefaultCategory) { <option class="ha-tabbtn" autocomplete="off">@app.Category</option> }
|
||||
}
|
||||
@if (Model.Texts != null && Model.Texts.Where(x => x.Category == Model.DefaultCategory).Any()) {
|
||||
<option class="ha-tabbtn" autocomplete="off">@Model.DefaultCategory</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
<div class="ha-lettertabs !hidden md:!block">
|
||||
@foreach (var app in Model.Texts)
|
||||
{
|
||||
@if (app.Category != Model.DefaultCategory) { <a class="ha-tabbtn">@app.Category</a> }
|
||||
@if (app.Category != Model.DefaultCategory) { <a class="ha-tabbtn hidden md:inline-block">@app.Category</a> }
|
||||
}
|
||||
@if (Model.Texts != null && Model.Texts.Where(x => x.Category == Model.DefaultCategory).Any()) {
|
||||
<a class="ha-tabbtn">@Model.DefaultCategory</a>
|
||||
<a class="ha-tabbtn hidden md:inline-block">@Model.DefaultCategory</a>
|
||||
}
|
||||
<a >PDF</a>
|
||||
</div>
|
||||
|
||||
@@ -38,7 +38,7 @@ module.exports = {
|
||||
},
|
||||
screens: {
|
||||
'sm': '700px',
|
||||
'md': '960px',
|
||||
'md': '940px',
|
||||
'desktop': '1190px',
|
||||
'xl': '1440px',
|
||||
'2xl': '1680px',
|
||||
|
||||
@@ -193,7 +193,7 @@
|
||||
}
|
||||
|
||||
.ha-text .ha-btn-collapsed-box {
|
||||
@apply absolute left-full ml-4 desktop:ml-[3.4rem] hidden md:inline-block cursor-pointer leading-none mt-0.5
|
||||
@apply absolute left-full ml-4 desktop:ml-[1.7rem] hidden md:inline-block cursor-pointer leading-none mt-[0.2rem]
|
||||
}
|
||||
|
||||
.ha-defaulttab .ha-hands {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,21 +1,26 @@
|
||||
// // Code specifically for the letter view
|
||||
let activetab = null;
|
||||
let activetabbtn = null;
|
||||
let activetabbtn2 = null;
|
||||
let tabbtnlist = document.querySelectorAll(".ha-tabbtn");
|
||||
let tablist = document.querySelectorAll(".ha-tab");
|
||||
|
||||
for (let i = 0; i < tabbtnlist.length; i++) {
|
||||
tablist[i].classList.add("hidden");
|
||||
tablist[i % tablist.length].classList.add("hidden");
|
||||
tabbtnlist[i].addEventListener("click", () => {
|
||||
if (activetab != null)
|
||||
activetab.classList.add("hidden");
|
||||
if (activetabbtn != null)
|
||||
if (activetabbtn != null)
|
||||
activetabbtn.classList.remove("active");
|
||||
if (activetabbtn2 != null)
|
||||
activetabbtn2.classList.remove("active");
|
||||
|
||||
tablist[i].classList.remove("hidden");
|
||||
tablist[i % tablist.length].classList.remove("hidden");
|
||||
tabbtnlist[i].classList.add("active");
|
||||
activetab = tablist[i];
|
||||
tabbtnlist[(i + tablist.length) % tabbtnlist.length].classList.add("active");
|
||||
activetab = tablist[i % tablist.length];
|
||||
activetabbtn = tabbtnlist[i];
|
||||
activetabbtn2 = tabbtnlist[(i + tablist.length) % tabbtnlist.length];
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -115,14 +115,14 @@ const overlappingcollapsebox = function (selector, hoverfunction) {
|
||||
let lines = Math.floor(eh / lineheight);
|
||||
let cutoff = Math.floor((h - newlength) / lineheight);
|
||||
m.style.cssText += "-webkit-line-clamp: " + (lines - cutoff) + ";";
|
||||
m.style.cssText += "line-clamp: " + (lines - cutoff) + ";";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
requestAnimationFrame(() => {
|
||||
collapsedboxes.push(element);
|
||||
collapsebox(element, newlength, lineheight);
|
||||
});
|
||||
requestAnimationFrame(() => {
|
||||
addbuttoncaollapsebox(element, newlength, hoverfunction);
|
||||
});
|
||||
}
|
||||
@@ -155,11 +155,36 @@ const collapseboxes = function () {
|
||||
overlappingcollapsebox(".ha-text .ha-marginalbox", true);
|
||||
};
|
||||
|
||||
var collapsedboxes = [];
|
||||
|
||||
const clearcollapsedboxes = function () {
|
||||
var elements = document.querySelectorAll(".ha-text .ha-marginalbox");
|
||||
elements.forEach(element => {
|
||||
element.removeAttribute("style");
|
||||
});
|
||||
collapsedboxes.forEach(element => {
|
||||
element.classList.remove("ha-expanded-box");
|
||||
element.classList.remove("ha-collapsed-box");
|
||||
element.outerHTML = element.outerHTML;
|
||||
});
|
||||
collapsedboxes = [];
|
||||
var elements = document.querySelectorAll(".ha-btn-collapsed-box");
|
||||
elements.forEach(element => {
|
||||
element.remove();
|
||||
});
|
||||
}
|
||||
|
||||
const resetall = function() {
|
||||
clearcollapsedboxes();
|
||||
marginalboxwidthset();
|
||||
collapseboxes();
|
||||
}
|
||||
|
||||
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);
|
||||
doit = this.setTimeout(resetall, 250);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user