WIP: Aureplop/kpsul js refactor #501

Draft
delobell wants to merge 215 commits from aureplop/kpsul_js_refactor into master
Showing only changes of commit 16dbfed977 - Show all commits

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);
}