##// END OF EJS Templates
Fixed tree positions for siblings that have children under them
neko259 -
r1488:bbb68318 default
parent child Browse files
Show More
@@ -291,10 +291,14 b' class Thread(models.Model):'
291 for depth, element in tree:
291 for depth, element in tree:
292 index += 1
292 index += 1
293 if element in parents:
293 if element in parents:
294 found_parent = True
295
294 offset_under_parent = parent_positions.get(element, 1)
296 offset_under_parent = parent_positions.get(element, 1)
295 tree.insert(index + offset_under_parent - 1, (depth + 1, reply))
297 tree.insert(index + offset_under_parent - 1, (depth + 1, reply))
296 parent_positions[element] = offset_under_parent + 1
298
297 found_parent = True
299 # Move whole parent tree by 1 added element
300 for parent in parents:
301 parent_positions[parent] = parent_positions.get(parent, 1) + 1
298
302
299 if not found_parent:
303 if not found_parent:
300 tree.append((0, reply))
304 tree.append((0, reply))
General Comments 0
You need to be logged in to leave comments. Login now