mirror of
https://github.com/jazzband/django-admin-sortable.git
synced 2026-03-20 07:50:34 +00:00
Added extra JS to deterine which element to highlight in the case where all fieldsets of a stacked inline are set to collapse.
This commit is contained in:
parent
2dab294b0c
commit
3757ca98c0
2 changed files with 13 additions and 1 deletions
|
|
@ -40,7 +40,9 @@
|
|||
type: 'POST',
|
||||
data: { indexes : indexes.join(',') },
|
||||
success: function() {
|
||||
ui.item.find('.form-row').effect('highlight', {}, 1000).removeAttr('style');
|
||||
var fieldsets = ui.item.find('fieldset'),
|
||||
highlightedSelector = fieldsets.filter('.collapsed').length === fieldsets.length ? 'h3' : '.form-row';
|
||||
ui.item.find(highlightedSelector).effect('highlight', {}, 1000);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,16 @@ admin.site.register(Category, SortableAdmin)
|
|||
|
||||
|
||||
class ComponentInline(SortableStackedInline):
|
||||
# fieldsets = (
|
||||
# ('foo', {
|
||||
# 'classes': ('collapse',),
|
||||
# 'fields': ('title',)
|
||||
# }),
|
||||
# ('', {
|
||||
# 'classes': ('collapse',),
|
||||
# 'fields': ('widget',)
|
||||
# }),
|
||||
# )
|
||||
model = Component
|
||||
|
||||
def queryset(self, request):
|
||||
|
|
|
|||
Loading…
Reference in a new issue