mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-13 02:58:17 -06:00
Enable remove_button plugin only for multi-select fields
This commit is contained in:
parent
b66cb6090c
commit
e164f049fa
BIN
netbox/project-static/dist/netbox.js.map
vendored
BIN
netbox/project-static/dist/netbox.js.map
vendored
Binary file not shown.
@ -3,22 +3,22 @@ interface PluginConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getPlugins(element: HTMLSelectElement): object {
|
export function getPlugins(element: HTMLSelectElement): object {
|
||||||
let plugins: PluginConfig = {}
|
const plugins: PluginConfig = {};
|
||||||
|
|
||||||
// Enable "clear all" button
|
// Enable "clear all" button
|
||||||
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')) {
|
||||||
plugins.remove_button = {
|
plugins.remove_button = {
|
||||||
title: 'Remove',
|
title: 'Remove',
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
plugins: plugins,
|
plugins: plugins,
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user