Updated UI
This commit is contained in:
@@ -1383,9 +1383,25 @@
|
||||
function bindGlobalEvents() {
|
||||
const importBtn = document.getElementById("importBtn");
|
||||
const importFile = document.getElementById("importFile");
|
||||
const exportToggle = document.querySelector(".export-toggle");
|
||||
const exportDropdown = document.querySelector(".export-dropdown");
|
||||
const exportMenu = document.getElementById("exportMenu");
|
||||
const exportDoxaApiBtn = document.getElementById("exportDoxaApiBtn");
|
||||
const exportOpenApiBtn = document.getElementById("exportOpenApiBtn");
|
||||
const exportSwaggerBtn = document.getElementById("exportSwaggerBtn");
|
||||
|
||||
exportToggle?.addEventListener("click", (event) => {
|
||||
event.stopPropagation();
|
||||
const isOpen = exportMenu?.classList.toggle("open");
|
||||
exportToggle.setAttribute("aria-expanded", String(!!isOpen));
|
||||
});
|
||||
|
||||
document.addEventListener("click", (event) => {
|
||||
if (!exportDropdown?.contains(event.target)) {
|
||||
exportMenu?.classList.remove("open");
|
||||
exportToggle?.setAttribute("aria-expanded", "false");
|
||||
}
|
||||
});
|
||||
const dashboardBtn = document.getElementById("dashboardBtn");
|
||||
const closeDashboard = document.getElementById("closeDashboard");
|
||||
const dashboardPanel = document.getElementById("dashboardPanel");
|
||||
@@ -1398,7 +1414,7 @@
|
||||
|
||||
const text = await file.text();
|
||||
|
||||
const res = await fetch("import", {
|
||||
const res = await fetch(new URL("import", document.baseURI), {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: text
|
||||
@@ -1435,7 +1451,7 @@
|
||||
|
||||
function download(url, filename) {
|
||||
const a = document.createElement("a");
|
||||
a.href = url;
|
||||
a.href = new URL(url, document.baseURI);
|
||||
a.download = filename;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
@@ -1475,7 +1491,7 @@
|
||||
const normalized = parsed.groups
|
||||
? parsed
|
||||
: await (async () => {
|
||||
const res = await fetch("import", {
|
||||
const res = await fetch(new URL("import", document.baseURI), {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: text
|
||||
|
||||
Reference in New Issue
Block a user