client/posts/edit: maintain post editing state for arrow key nav
Fixes #373
This commit is contained in:
parent
2b9a4ab786
commit
b9451bef4a
1 changed files with 18 additions and 2 deletions
|
@ -61,13 +61,29 @@ class PostMainView {
|
|||
|
||||
const showPreviousImage = () => {
|
||||
if (ctx.prevPostId) {
|
||||
router.show(ctx.getPostUrl(ctx.prevPostId, ctx.parameters));
|
||||
if (ctx.editMode) {
|
||||
router.show(
|
||||
ctx.getPostEditUrl(ctx.prevPostId, ctx.parameters)
|
||||
);
|
||||
} else {
|
||||
router.show(
|
||||
ctx.getPostUrl(ctx.prevPostId, ctx.parameters)
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const showNextImage = () => {
|
||||
if (ctx.nextPostId) {
|
||||
router.show(ctx.getPostUrl(ctx.nextPostId, ctx.parameters));
|
||||
if (ctx.editMode) {
|
||||
router.show(
|
||||
ctx.getPostEditUrl(ctx.nextPostId, ctx.parameters)
|
||||
);
|
||||
} else {
|
||||
router.show(
|
||||
ctx.getPostUrl(ctx.nextPostId, ctx.parameters)
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue