From 5012a10298f420471816ca957cde96b821f54f33 Mon Sep 17 00:00:00 2001 From: Dariusz Niemczyk Date: Mon, 17 Jul 2023 22:44:44 +0200 Subject: [PATCH] Hack: admin props combobox works(?) --- .../django_admin_hstore_widget/django_admin_hstore_widget.js | 4 ++-- storage/templates/admin/storage/item/change_form.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/static/admin/js/django_admin_hstore_widget/django_admin_hstore_widget.js b/static/admin/js/django_admin_hstore_widget/django_admin_hstore_widget.js index 07295a3..1d8cd7d 100644 --- a/static/admin/js/django_admin_hstore_widget/django_admin_hstore_widget.js +++ b/static/admin/js/django_admin_hstore_widget/django_admin_hstore_widget.js @@ -120,7 +120,7 @@ var initDjangoHStoreWidget = function (hstore_field_name, inline_prefix) { $hstore.delegate("a.hs-add-row, .hs-add-row a", "click", function (e) { e.preventDefault(); $hstore.find(".hstore-rows").append(empty_row); - $(".django-select2").djangoSelect2(); + $(".django-select2").select2(); $("select").on("select2:close", function () { $(this).focus(); }); @@ -157,7 +157,7 @@ var initDjangoHStoreWidget = function (hstore_field_name, inline_prefix) { hstore_rows.show(); add_row.show(); - $(".django-select2").djangoSelect2(); + $(".django-select2").select2(); } else { raw_textarea.show(); hstore_rows.hide(); diff --git a/storage/templates/admin/storage/item/change_form.html b/storage/templates/admin/storage/item/change_form.html index b6290cd..211bbab 100644 --- a/storage/templates/admin/storage/item/change_form.html +++ b/storage/templates/admin/storage/item/change_form.html @@ -29,7 +29,7 @@ result.find("b").text(state.text); return result; } - django.jQuery(".django-select2[name=parent]").djangoSelect2({ + django.jQuery(".django-select2[name=parent]").select2({ templateResult: fmt, }); /**