1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

fixes #2837 - select2 nullable filter fields add multiple null_option elements when paging

This commit is contained in:
John Anderson
2019-01-31 13:56:36 -05:00
parent bcfa760cf9
commit fe00db62d6
2 changed files with 3 additions and 2 deletions

View File

@ -11,6 +11,7 @@ v2.5.5 (FUTURE)
* [#2824](https://github.com/digitalocean/netbox/issues/2824) - Fix template exception when viewing rack elevations list
* [#2833](https://github.com/digitalocean/netbox/issues/2833) - Fix form widget for front port template creation
* [#2835](https://github.com/digitalocean/netbox/issues/2835) - Fix certain model filters did not support the `q` query param
* [#2837](https://github.com/digitalocean/netbox/issues/2837) - Fix select2 nullable filter fields add multiple null_option elements when paging
---

View File

@ -197,8 +197,8 @@ $(document).ready(function() {
return obj;
});
// Handle the null option
if (element.getAttribute('data-null-option')) {
// Handle the null option, but only add it once
if (element.getAttribute('data-null-option') && data.previous === null) {
var null_option = $(element).children()[0]
results.unshift({
id: null_option.value,