DEV: allow composer option to skip jumping to a post on save (#14675)
* DEV: allow composer option to skip jumping to a post on save * DEV: refactor js safe access in jump logic Co-authored-by: Jarek Radosz <jradosz@gmail.com>
This commit is contained in:
parent
61a7fbdd9e
commit
6192189fd2
|
@ -632,7 +632,9 @@ export default Controller.extend({
|
|||
},
|
||||
|
||||
save(ignore, event) {
|
||||
this.save(false, { jump: !(event && event.shiftKey) });
|
||||
this.save(false, {
|
||||
jump: !event?.shiftKey && !this.skipJumpOnSave,
|
||||
});
|
||||
},
|
||||
|
||||
displayEditReason() {
|
||||
|
@ -956,6 +958,7 @@ export default Controller.extend({
|
|||
@param {Number} [opts.prioritizedCategoryId]
|
||||
@param {String} [opts.draftSequence]
|
||||
@param {Boolean} [opts.skipDraftCheck]
|
||||
@param {Boolean} [opts.skipJumpOnSave] Option to skip navigating to the post when saved in this composer session
|
||||
**/
|
||||
open(opts) {
|
||||
opts = opts || {};
|
||||
|
@ -982,6 +985,8 @@ export default Controller.extend({
|
|||
skipAutoSave: true,
|
||||
});
|
||||
|
||||
this.set("skipJumpOnSave", !!opts.skipJumpOnSave);
|
||||
|
||||
// Scope the categories drop down to the category we opened the composer with.
|
||||
if (opts.categoryId && !opts.disableScopedCategory) {
|
||||
const category = this.site.categories.findBy("id", opts.categoryId);
|
||||
|
|
Loading…
Reference in New Issue