From e164f049fac52a815523e1af044eff5c1a594d32 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Thu, 2 May 2024 09:09:48 -0400 Subject: [PATCH] Enable remove_button plugin only for multi-select fields --- netbox/project-static/dist/netbox.js.map | Bin 340581 -> 340581 bytes netbox/project-static/src/select/config.ts | 8 ++++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/netbox/project-static/dist/netbox.js.map b/netbox/project-static/dist/netbox.js.map index a393bdba0f55521e8cf158199b03d6a4672d6067..2e165eee620469e4301e0eab7f401743c2e3387d 100644 GIT binary patch delta 40 wcmaF*MC9ock%kt=7N!>FEi6xUczks{9UaS^ble@?E!#ipux$UR!&<@$08IN1%>V!Z delta 40 wcmaF*MC9ock%kt=7N!>FEi6xUcszAH9UaS^ble@?P1`@}ux$UR!&<@$08Dod#Q*>R diff --git a/netbox/project-static/src/select/config.ts b/netbox/project-static/src/select/config.ts index 8d61c72b7..c655b5271 100644 --- a/netbox/project-static/src/select/config.ts +++ b/netbox/project-static/src/select/config.ts @@ -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) => ``, - } + }; // Enable individual "remove" buttons for items on multi-select fields if (element.hasAttribute('multiple')) { plugins.remove_button = { title: 'Remove', - } + }; } return { plugins: plugins, - } + }; }