Skip to content

Commit

Permalink
Merge pull request #421 from helio-correia/translationtabs
Browse files Browse the repository at this point in the history
Make it work if the admin are divided by tabs
  • Loading branch information
deschler committed Jan 26, 2018
2 parents af5b7bf + f317541 commit c9bb6a5
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -395,7 +395,7 @@ var google, django, gettext;
// Group normal fields and fields in (existing) stacked inlines
var grouper = new TranslationFieldGrouper({
$fields: $('.mt').filter(
'input:visible, textarea:visible, select:visible, iframe, div').filter(':parents(.tabular)')
'input, textarea, select, iframe, div').filter(':parents(.tabular)')
});
MainSwitch.init(grouper.groupedTranslations, createTabs(grouper.groupedTranslations));

Expand Down

1 comment on commit c9bb6a5

@steuraa
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change breaks the normal working of TranslationStackedInline fields by already selecting and creating tabgroups on optional inline models that are not visible yet.
The normal flow of adding a inline model afterwards gets messed up (jQuery selects wrong entrypoint I guess) and extra freefloating translation tabs get added.
These in their turn break the adding of more inline models.
Added an image to clarify what I mean
messed up inlinemodel

Restoring this line to select only visible input/textarea/select restore functionality.

Please sign in to comment.