From 57ea73db469b64543ee4691c85cfb98bb051493b Mon Sep 17 00:00:00 2001 From: Saria Hajjar Date: Wed, 1 Jan 2020 21:01:08 +0000 Subject: [PATCH 1/2] Turn off Select2 static width calculation --- netbox/project-static/js/forms.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/netbox/project-static/js/forms.js b/netbox/project-static/js/forms.js index 9303e301314..8eff1e00ae0 100644 --- a/netbox/project-static/js/forms.js +++ b/netbox/project-static/js/forms.js @@ -103,14 +103,16 @@ $(document).ready(function() { placeholder: "---------", theme: "bootstrap", templateResult: colorPickerClassCopy, - templateSelection: colorPickerClassCopy + templateSelection: colorPickerClassCopy, + width: "off" }); // Static choice selection $('.netbox-select2-static').select2({ allowClear: true, placeholder: "---------", - theme: "bootstrap" + theme: "bootstrap", + width: "off" }); // API backed selection @@ -120,6 +122,7 @@ $(document).ready(function() { allowClear: true, placeholder: "---------", theme: "bootstrap", + width: "off", ajax: { delay: 500, @@ -299,7 +302,7 @@ $(document).ready(function() { multiple: true, allowClear: true, placeholder: "Tags", - + width: "off", ajax: { delay: 250, url: netbox_api_path + "extras/tags/", From cfa078c9291a06830025f984a79e96430cbee0fd Mon Sep 17 00:00:00 2001 From: Saria Hajjar Date: Wed, 1 Jan 2020 21:14:38 +0000 Subject: [PATCH 2/2] Added theme to select2 of tags --- netbox/project-static/js/forms.js | 1 + 1 file changed, 1 insertion(+) diff --git a/netbox/project-static/js/forms.js b/netbox/project-static/js/forms.js index 8eff1e00ae0..55f9afbd5f4 100644 --- a/netbox/project-static/js/forms.js +++ b/netbox/project-static/js/forms.js @@ -302,6 +302,7 @@ $(document).ready(function() { multiple: true, allowClear: true, placeholder: "Tags", + theme: "bootstrap", width: "off", ajax: { delay: 250,