version 4.8.17 -- カレンダーで今日以降しか選べないようにした

This commit is contained in:
hayano
2024-08-09 23:49:36 +00:00
parent 3d195973fc
commit 95b787c819
255 changed files with 59200 additions and 53 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;
}
}
}
}