django-nested-inline icon indicating copy to clipboard operation
django-nested-inline copied to clipboard

"Add object" button positions weirdly in tabbed inlines w/ side effect on modeltranslation

Open LeGast00n opened this issue 10 years ago • 2 comments
trafficstars

Hi there,

The solution is just to change line 45 of the inline-nested.js to the following: if ($this.prop("tagName") == "TR") {

(instead of $this.attr("tagName") )

Otherwise, the test above is always false and the Add button is positioned as a div. This has a side effect on how model translation tabs are processed in tabular inlines.

Cheers LA

LeGast00n avatar Jul 02 '15 15:07 LeGast00n

Hi,

unfortunately this solution works just for one nested form. If you have more than one nested form the nested-nested add button is placed in the middle of two higher level buttons, here the screenshot

nested-inline

A possible workaround is to replace the

$parent.append('

' + options.addText + ""); addButton = $parent.find("tr:last a");

contained in the "if ($this.prop("tagName") == "TR")" --> TRUE condition with

$this.filter(":last").after('

' + options.addText + ""); addButton = $this.filter(":last").next().find("a");

in part taken from the FALSE condition.

best,

AF

paxelito avatar Jul 21 '15 12:07 paxelito

The duplicate of this issue in #15 also has a PR that fixes it in #34

spither avatar Mar 02 '17 10:03 spither