BUGFIX Correct DOM structure on updating tree nodes from edit forms, adding badge classes to force strike-through styling on deleted nodes (see #7410)

This commit is contained in:
Ingo Schommer 2012-06-12 19:16:34 +02:00
parent 2637969bcd
commit 896d198890

View File

@ -223,7 +223,15 @@
// set title (either from TreeTitle or from Title fields)
// Treetitle has special HTML formatting to denote the status changes.
if(title) this.jstree('rename_node', node, title);
if(title) node.find('.text').html(title);
// Collect flag classes and also apply to parent
var statusFlags = [];
node.children('a').find('.badge').each(function() {
statusFlags = statusFlags.concat($(this).attr('class').replace('badge', '').split(' '));
});
// TODO Doesn't remove classes, gets too complex: Best handled through complete serverside replacement
node.addClass(statusFlags.join(' '));
// check if node exists, might have been created instead
if(!node.length) {