1
0
Fork 0
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:
Murod Khaydarov 2019-01-19 17:09:11 +03:00 committed by GitHub
parent dbfc594e66
commit d61818761e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 1069 additions and 2563 deletions

View file

@ -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
};
}