Skip to content
Snippets Groups Projects
Commit faa0042d authored by Ron Lucke's avatar Ron Lucke
Browse files

fix #1620

Closes #1620

Merge request studip/studip!1043
parent ff24292c
No related branches found
No related tags found
No related merge requests found
......@@ -79,8 +79,13 @@ export default {
if (!this.container) {
return [];
}
let containerBlocks = this.container.relationships.blocks.data.map(({ id }) => this.blockById({ id })).filter(Boolean);
let unallocated = new Set(containerBlocks.map(({ id }) => id));
let sortedBlocks = this.container.attributes.payload.sections[0].blocks.map((id) => this.blockById({ id })).filter(Boolean);
sortedBlocks.forEach(({ id }) => unallocated.delete(id));
let unallocatedBlocks = [...unallocated].map((id) => this.blockById({ id }));
return this.container.relationships.blocks.data.map(({ id }) => this.blockById({ id })).filter(Boolean);
return sortedBlocks.concat(unallocatedBlocks);
},
showEditMode() {
return this.$store.getters.viewMode === 'edit';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment