Added creation modal auto-popup when following create asset link

This commit is contained in:
2025-11-01 10:08:21 +01:00
parent d29f56d795
commit 7aa0ae7f0a
2 changed files with 12 additions and 1 deletions

View File

@@ -256,6 +256,17 @@
<script>
document.addEventListener('DOMContentLoaded', () => {
// Open modal if URL contains parameter: CreateModal=true
const urlParams = new URLSearchParams(window.location.search);
if (urlParams.get('CreateModal') === 'true') {
const button = document.querySelector('[data-bs-toggle="modal"][data-bs-target="#createAssetModal"]');
if (button) {
button.click();
urlParams.delete('CreateModal');
const newUrl = window.location.pathname + '?' + urlParams.toString();
history.replaceState({}, '', newUrl);
}
}
const attributesContainer = document.getElementById('attributesContainer');
const addAttributeBtn = document.getElementById('addAttributeBtn');