Permalink
Browse files

BUGFIX Correct DOM structure on updating tree nodes from edit forms, …

…adding badge classes to force strike-through styling on deleted nodes (see #7410)
  • Loading branch information...
1 parent 2637969 commit 896d198890daf083d4dde1273ba53b192c007232 @chillu chillu committed Jun 12, 2012
Showing with 9 additions and 1 deletion.
  1. +9 −1 admin/javascript/LeftAndMain.Tree.js
@@ -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) {

0 comments on commit 896d198

Please sign in to comment.