initial commit

This commit is contained in:
Joren de Graaf
2026-09-26 20:59:01 +02:00
parent e07f08c791
commit 966d6602c2
202 changed files with 36684 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
"use strict";
{
const inputTags = ["BUTTON", "INPUT", "SELECT", "TEXTAREA"];
const modelName = document.getElementById("django-admin-form-add-constants")
.dataset.modelName;
if (modelName) {
const form = document.getElementById(modelName + "_form");
for (const element of form.elements) {
// HTMLElement.offsetParent returns null when the element is not
// rendered.
if (
inputTags.includes(element.tagName) &&
!element.disabled &&
element.offsetParent
) {
element.focus();
break;
}
}
}
}