mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-27 02:48:38 -06:00
Include the 'clear' button only for non-required fields
This commit is contained in:
parent
d332a0c0d7
commit
9c180c9f75
BIN
netbox/project-static/dist/netbox.js
vendored
BIN
netbox/project-static/dist/netbox.js
vendored
Binary file not shown.
BIN
netbox/project-static/dist/netbox.js.map
vendored
BIN
netbox/project-static/dist/netbox.js.map
vendored
Binary file not shown.
@ -5,11 +5,13 @@ interface PluginConfig {
|
|||||||
export function getPlugins(element: HTMLSelectElement): object {
|
export function getPlugins(element: HTMLSelectElement): object {
|
||||||
const plugins: PluginConfig = {};
|
const plugins: PluginConfig = {};
|
||||||
|
|
||||||
// Enable "clear all" button
|
// Enable "clear all" button for non-required fields
|
||||||
|
if (!element.required) {
|
||||||
plugins.clear_button = {
|
plugins.clear_button = {
|
||||||
html: (data: Dict) =>
|
html: (data: Dict) =>
|
||||||
`<i class="mdi mdi-close-circle ${data.className}" title="${data.title}"></i>`,
|
`<i class="mdi mdi-close-circle ${data.className}" title="${data.title}"></i>`,
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// Enable individual "remove" buttons for items on multi-select fields
|
// Enable individual "remove" buttons for items on multi-select fields
|
||||||
if (element.hasAttribute('multiple')) {
|
if (element.hasAttribute('multiple')) {
|
||||||
|
Loading…
Reference in New Issue
Block a user