Code

Ticket #12882: 12882.2.diff

File 12882.2.diff, 1.4 KB (added by jezdez, 4 years ago)

The collapse widget needs jQuery, too

Line 
1diff --git a/django/contrib/admin/helpers.py b/django/contrib/admin/helpers.py
2index 3c1febd..84d6e20 100644
3--- a/django/contrib/admin/helpers.py
4+++ b/django/contrib/admin/helpers.py
5@@ -75,7 +75,8 @@ class Fieldset(object):
6 
7     def _media(self):
8         if 'collapse' in self.classes:
9-            return forms.Media(js=['%sjs/collapse.min.js' % settings.ADMIN_MEDIA_PREFIX])
10+            js = ['js/jquery.min.js', 'js/collapse.min.js']
11+            return forms.Media(js=['%s%s' % (settings.ADMIN_MEDIA_PREFIX, url) for url in js])
12         return forms.Media()
13     media = property(_media)
14 
15diff --git a/django/contrib/admin/templates/admin/edit_inline/stacked.html b/django/contrib/admin/templates/admin/edit_inline/stacked.html
16index fb112a0..2c7e878 100644
17--- a/django/contrib/admin/templates/admin/edit_inline/stacked.html
18+++ b/django/contrib/admin/templates/admin/edit_inline/stacked.html
19@@ -63,5 +63,5 @@
20             })
21         });
22     });
23-})(jQuery.noConflict());
24+})(jQuery.noConflict(true));
25 </script>
26diff --git a/django/contrib/admin/templates/admin/edit_inline/tabular.html b/django/contrib/admin/templates/admin/edit_inline/tabular.html
27index dc9552f..ecbed7c 100644
28--- a/django/contrib/admin/templates/admin/edit_inline/tabular.html
29+++ b/django/contrib/admin/templates/admin/edit_inline/tabular.html
30@@ -109,5 +109,5 @@
31             })
32         });
33     });
34-})(jQuery.noConflict());
35+})(jQuery.noConflict(true));
36 </script>