Add chidren div in display

This commit is contained in:
Ludovic Stephan 2017-04-24 14:12:03 -03:00
parent 5096e5f129
commit 16dbfed977

View file

@ -1302,10 +1302,12 @@ class ForestDisplay {
else
children.sort(children[0].constructor.compare);
var $child_div = $('<div class="children"></div>');
for (let child of children) {
var $child = this.render_element(child, options);
$container.append($child);
$child_div.append($child);
}
$container.append($child_div);
}
return $container;
@ -1329,10 +1331,9 @@ class ForestDisplay {
}
var $to_insert = this.render_element(first_missing, options);
//TODO better placement
if (existing) {
this._$container.find('#'+existing.constructor.verbose_name+'-'+existing.id+'>:first-child')
.after($to_insert);
this._$container.find('#'+existing.constructor.verbose_name+'-'+existing.id+'>.children')
.prepend($to_insert);
} else {
this._$container.prepend($to_insert);
}