mirror of
https://github.com/Theodor-Springmann-Stiftung/hamann-ausgabe-core.git
synced 2025-10-29 09:15:33 +00:00
splitting all js into individual files to comparmentalize and getting rid of onload event (in favour of defer)
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
ViewData["showCredits"] = "false";
|
||||
}
|
||||
|
||||
<script defer src="/js/upload.js" asp-append-version="true"></script>
|
||||
|
||||
<div class="ha-adminuploadfields" id="ha-adminuploadfields">
|
||||
@foreach (var item in Model.AvailableRoots!.OrderBy(x => x.Type)) {
|
||||
<a class="ha-uploadfield" asp-controller="Upload" asp-action="Index" asp-route-id="@item.Prefix">
|
||||
@@ -95,33 +97,4 @@
|
||||
</div>
|
||||
}
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
"use strict";
|
||||
const hideshowfiles = function() {
|
||||
let elem = document.getElementById("ha-availablefileslist");
|
||||
if (elem.classList.contains('hidden')) {
|
||||
|
||||
elem.classList.remove('hidden');
|
||||
elem.classList.add('block');
|
||||
}
|
||||
else {
|
||||
elem.classList.add('hidden');
|
||||
elem.classList.remove('block');
|
||||
}
|
||||
}
|
||||
|
||||
function getCookie(name) {
|
||||
var value = "; " + document.cookie;
|
||||
var parts = value.split("; " + name + "=");
|
||||
if (parts.length == 2) return parts.pop().split(";").shift();
|
||||
}
|
||||
|
||||
window.addEventListener("load", function () {
|
||||
var filesbutton = document.getElementById("ha-availablefiles");
|
||||
if (filesbutton !== null)
|
||||
filesbutton.addEventListener("click", () => hideshowfiles());
|
||||
});
|
||||
</script>
|
||||
|
||||
</div>
|
||||
Reference in New Issue
Block a user