mirror of
https://github.com/imgfloat/server.git
synced 2026-02-05 11:49:25 +00:00
Improve script UI
This commit is contained in:
@@ -110,9 +110,9 @@ export function createAdminConsole({
|
||||
handleFileSelection(event.target);
|
||||
});
|
||||
}
|
||||
const customAssetButton = document.getElementById("custom-asset-button");
|
||||
if (customAssetButton && customAssetModal?.openLauncher) {
|
||||
customAssetButton.addEventListener("click", () => customAssetModal.openLauncher());
|
||||
const assetLauncherButton = document.getElementById("asset-launcher-button");
|
||||
if (assetLauncherButton && customAssetModal?.openLauncher) {
|
||||
assetLauncherButton.addEventListener("click", () => customAssetModal.openLauncher());
|
||||
}
|
||||
globalThis.addEventListener("resize", () => {
|
||||
resizeCanvas();
|
||||
|
||||
@@ -7,6 +7,7 @@ export function createCustomAssetModal({
|
||||
const launchModal = document.getElementById("custom-asset-launch-modal");
|
||||
const launchNewButton = document.getElementById("custom-asset-launch-new");
|
||||
const launchMarketplaceButton = document.getElementById("custom-asset-launch-marketplace");
|
||||
const assetFileInput = document.getElementById("asset-file");
|
||||
const marketplaceModal = document.getElementById("custom-asset-marketplace-modal");
|
||||
const marketplaceCloseButton = document.getElementById("custom-asset-marketplace-close");
|
||||
const marketplaceSearchInput = document.getElementById("custom-asset-marketplace-search");
|
||||
@@ -234,6 +235,13 @@ export function createCustomAssetModal({
|
||||
if (launchMarketplaceButton) {
|
||||
launchMarketplaceButton.addEventListener("click", () => openMarketplaceModal());
|
||||
}
|
||||
if (assetFileInput) {
|
||||
assetFileInput.addEventListener("change", (event) => {
|
||||
if (event.target?.files?.length) {
|
||||
closeLaunchModal();
|
||||
}
|
||||
});
|
||||
}
|
||||
if (marketplaceModal) {
|
||||
marketplaceModal.addEventListener("click", (event) => {
|
||||
if (event.target === marketplaceModal) {
|
||||
|
||||
Reference in New Issue
Block a user