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 {
|
||||
let plugins: PluginConfig = {}
|
||||
const plugins: PluginConfig = {};
|
||||
|
||||
// Enable "clear all" button
|
||||
plugins.clear_button = {
|
||||
html: (data: Dict) =>
|
||||
`<i class="mdi mdi-close-circle ${data.className}" title="${data.title}"></i>`,
|
||||
}
|
||||
};
|
||||
|
||||
// Enable individual "remove" buttons for items on multi-select fields
|
||||
if (element.hasAttribute('multiple')) {
|
||||
plugins.remove_button = {
|
||||
title: 'Remove',
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
plugins: plugins,
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user