darklow / django-suit

Modern theme for Django admin interface
http://djangosuit.com/
Other
2.32k stars 704 forks source link

order of suit media files #743

Open tyctor opened 4 years ago

tyctor commented 4 years ago

whe i use SortableGenericTabularInline from suit/sortables.py it loads javascript code before django's jquery.init.js

<script type="text/javascript" src="/admin-static/suit/js/suit.sortables.js"></script>
<script type="text/javascript" src="/admin-static/admin/js/jquery.init.js"></script>

but in your demo app it is loaded as last js file can you please advise me how to achieve this order in my app?

tyctor commented 4 years ago

i created custom admin classes to preserve loading order, but i think there should be some standart solution for this, is there some?

class CustomTabularInline(SortableTabularInline):
    class Media:
        js = ('admin/js/jquery.init.js', 'suit/js/suit.sortables.js',)

class CustomGenericTabularInline(SortableGenericTabularInline):
    class Media:
        js = ('admin/js/jquery.init.js', 'suit/js/suit.sortables.js',)