mirror of
https://github.com/codex-team/codex.docs.git
synced 2025-07-23 15:19:41 +02:00
Order child pages (#21)
* save ordering pages * move to another collection * requested changes. Code improvements * add margin * unit tests * fix * requested changes * recursive method: create menu tree * update comments * fix bug * requested changes * move const * fix error message on catch * add migration * rewrite to splices * move methods * testing put above method * linter fix
This commit is contained in:
parent
dbfc594e66
commit
d61818761e
20 changed files with 1069 additions and 2563 deletions
|
@ -27,7 +27,8 @@ export default class Writing {
|
|||
this.nodes = {
|
||||
editorWrapper: null,
|
||||
saveButton: null,
|
||||
parentIdSelector: null
|
||||
parentIdSelector: null,
|
||||
putAboveIdSelector: null,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -61,6 +62,7 @@ export default class Writing {
|
|||
this.saveButtonClicked();
|
||||
});
|
||||
this.nodes.parentIdSelector = moduleEl.querySelector('[name="parent"]');
|
||||
this.nodes.putAboveIdSelector = moduleEl.querySelector('[name="above"]');
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -89,8 +91,15 @@ export default class Writing {
|
|||
throw new Error('Entry should start with Header');
|
||||
}
|
||||
|
||||
/** get ordering selector value */
|
||||
let putAbovePageId = null;
|
||||
if (this.nodes.putAboveIdSelector) {
|
||||
putAbovePageId = this.nodes.putAboveIdSelector.value;
|
||||
}
|
||||
|
||||
return {
|
||||
parent: this.nodes.parentIdSelector.value,
|
||||
putAbovePageId: putAbovePageId,
|
||||
body: editorData
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue