mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Remove obsolete TS for a.formaction
This commit is contained in:
14
netbox/project-static/dist/netbox.js
vendored
14
netbox/project-static/dist/netbox.js
vendored
File diff suppressed because one or more lines are too long
4
netbox/project-static/dist/netbox.js.map
vendored
4
netbox/project-static/dist/netbox.js.map
vendored
File diff suppressed because one or more lines are too long
@ -1,28 +0,0 @@
|
|||||||
import { getElements, findFirstAdjacent, isTruthy } from '../util';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Handle bulk add/edit/rename form actions.
|
|
||||||
*
|
|
||||||
* @param event Click Event
|
|
||||||
*/
|
|
||||||
function handleFormActionClick(event: Event): void {
|
|
||||||
event.preventDefault();
|
|
||||||
const element = event.currentTarget as HTMLElement;
|
|
||||||
if (element !== null) {
|
|
||||||
const form = findFirstAdjacent<HTMLFormElement>(element, 'form');
|
|
||||||
const href = element.getAttribute('href');
|
|
||||||
if (form !== null && isTruthy(href)) {
|
|
||||||
form.setAttribute('action', href);
|
|
||||||
form.submit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialize bulk form action links.
|
|
||||||
*/
|
|
||||||
export function initFormActions(): void {
|
|
||||||
for (const element of getElements<HTMLAnchorElement>('a.formaction')) {
|
|
||||||
element.addEventListener('click', handleFormActionClick);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,17 +1,10 @@
|
|||||||
import { initFormActions } from './actions';
|
|
||||||
import { initFormElements } from './elements';
|
import { initFormElements } from './elements';
|
||||||
import { initSpeedSelector } from './speedSelector';
|
import { initSpeedSelector } from './speedSelector';
|
||||||
import { initScopeSelector } from './scopeSelector';
|
import { initScopeSelector } from './scopeSelector';
|
||||||
import { initVlanTags } from './vlanTags';
|
import { initVlanTags } from './vlanTags';
|
||||||
|
|
||||||
export function initForms(): void {
|
export function initForms(): void {
|
||||||
for (const func of [
|
for (const func of [initFormElements, initSpeedSelector, initScopeSelector, initVlanTags]) {
|
||||||
initFormActions,
|
|
||||||
initFormElements,
|
|
||||||
initSpeedSelector,
|
|
||||||
initScopeSelector,
|
|
||||||
initVlanTags,
|
|
||||||
]) {
|
|
||||||
func();
|
func();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user