Ticket #6619: add_js.diff

File add_js.diff, 958 bytes (added by mrts, 11 years ago)

Add missing custom js handling

  • django/contrib/admin/options.py

     
    221221    save_on_top = False
    222222    ordering = None
    223223    inlines = []
     224    js = []
    224225
    225226    def __init__(self, model, admin_site):
    226227        self.model = model
     
    267268            js.extend(['js/getElementsBySelector.js', 'js/dom-drag.js' , 'js/admin/ordering.js'])
    268269        if self.filter_vertical or self.filter_horizontal:
    269270            js.extend(['js/SelectBox.js' , 'js/SelectFilter2.js'])
     271        js_list = ['%s%s' % (settings.ADMIN_MEDIA_PREFIX, url) for url in js]
     272        js_list += self.js
    270273       
    271         return forms.Media(js=['%s%s' % (settings.ADMIN_MEDIA_PREFIX, url) for url in js])
     274        return forms.Media(js=js_list)
    272275    media = property(_media)
    273276   
    274277    def has_add_permission(self, request):
Back to Top