Insert new content block at first position
This commit is contained in:
parent
d6b3fc09cb
commit
ec03c03c48
|
|
@ -113,8 +113,12 @@ class AddContentBlock(relay.ClientIDMutation):
|
|||
|
||||
if parent is not None:
|
||||
parent_chapter = get_object(Chapter, parent).specific
|
||||
first_sibling = parent_chapter.get_first_child()
|
||||
if first_sibling is not None:
|
||||
first_sibling.add_sibling(instance=new_content_block, pos='left')
|
||||
else:
|
||||
parent_chapter.add_child(instance=new_content_block)
|
||||
if after is not None:
|
||||
elif after is not None:
|
||||
sibling = get_object(ContentBlock, after).specific
|
||||
sibling.add_sibling(instance=new_content_block, pos='right')
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue