mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Issue10352 removegetvariables (#10475)
* Add javascript to disable empty form fields * add js cleanGetUrl * use addEventListener submit * use addEventListener * update collectstatics * Use FormData to remove empty fields * optimeze ts-ignore * update ts-ignore comment * oneline of ts-ignore * one line of ts-ingnore * fix tsc errors by adding types (as per kkthxbye) Co-authored-by: Pieter Lambrecht <pieter.lambrecht@sentia.com>
This commit is contained in:
2
netbox/project-static/dist/netbox.js
vendored
2
netbox/project-static/dist/netbox.js
vendored
File diff suppressed because one or more lines are too long
2
netbox/project-static/dist/netbox.js.map
vendored
2
netbox/project-static/dist/netbox.js.map
vendored
File diff suppressed because one or more lines are too long
@ -37,6 +37,20 @@ function initDocument(): void {
|
||||
}
|
||||
|
||||
function initWindow(): void {
|
||||
|
||||
const documentForms = document.forms
|
||||
for (var documentForm of documentForms) {
|
||||
if (documentForm.method.toUpperCase() == 'GET') {
|
||||
// @ts-ignore: Our version of typescript seems to be too old for FormDataEvent
|
||||
documentForm.addEventListener('formdata', function(event: FormDataEvent) {
|
||||
let formData: FormData = event.formData;
|
||||
for (let [name, value] of Array.from(formData.entries())) {
|
||||
if (value === '') formData.delete(name);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const contentContainer = document.querySelector<HTMLElement>('.content-container');
|
||||
if (contentContainer !== null) {
|
||||
// Focus the content container for accessible navigation.
|
||||
|
Reference in New Issue
Block a user