mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Fixed broken loading state on transition between posts in editor (#1021)
closes https://github.com/TryGhost/Ghost/issues/9582 - clear the `post` model on the `editor` controller when swapping models to avoid the editor contents and the editor loading state being displayed simultaneously
This commit is contained in:
parent
ab5267ab87
commit
033ec0ce1a
1 changed files with 12 additions and 0 deletions
|
@ -1,6 +1,18 @@
|
||||||
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
||||||
|
|
||||||
export default AuthenticatedRoute.extend({
|
export default AuthenticatedRoute.extend({
|
||||||
|
beforeModel(transition) {
|
||||||
|
this._super(...arguments);
|
||||||
|
|
||||||
|
// if the transition is not new->edit, reset the post on the controller
|
||||||
|
// so that the editor view is cleared before showing the loading state
|
||||||
|
if (transition.urlMethod !== 'replace') {
|
||||||
|
let editor = this.controllerFor('editor');
|
||||||
|
editor.set('post', null);
|
||||||
|
editor.reset();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
model(params) {
|
model(params) {
|
||||||
let query = {
|
let query = {
|
||||||
id: params.post_id,
|
id: params.post_id,
|
||||||
|
|
Loading…
Add table
Reference in a new issue