Miroca_Server_file_static

This commit is contained in:
Victor Alexandrovich Tsyrenschikov
2026-01-02 15:08:38 +05:00
parent 0df2ccb03c
commit 0495a3069a
409 changed files with 193583 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
'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;
}
}
}
}