django-suit icon indicating copy to clipboard operation
django-suit copied to clipboard

order of suit media files

Open tyctor opened this issue 5 years ago • 1 comments

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 avatar Dec 10 '19 12:12 tyctor

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',)

tyctor avatar Dec 10 '19 12:12 tyctor