Skip to content
Snippets Groups Projects
Commit 73bb52c6 authored by Hermann's avatar Hermann
Browse files

fix reloading of item content after patch

parent 9d30c51a
No related branches found
No related tags found
No related merge requests found
......@@ -44,7 +44,7 @@ export default class ItemController {
changeModus(newModus) {
this.modus = newModus;
if (this.modus === 'view') {
if (newModus === 'view') {
// reload item to current state, patches do not return embeddinds...
this.handler.getItem(this.id, this.embedded).then((item) => {
this.data = item;
......
......@@ -21,8 +21,8 @@ export default class ItemView {
*/
constructor({ attrs: { controller, onDelete } }) {
this.controller = controller;
this.data = this.controller.data;
this.handler = this.controller.handler;
this.data = this.controller.data;
this.resource = this.controller.resource;
if (!onDelete) this.onDelete = () => { m.route.set(`/${controller.resource}`); };
else this.onDelete = onDelete;
......@@ -51,6 +51,9 @@ export default class ItemView {
layout(children) {
if (!this.controller || !this.controller.data) return '';
// update the reference to the controller data, as this may be refreshed
// in between
this.data = this.controller.data;
return m('div', [
m(Toolbar, m('div.pe-button-row', [
m(Button, {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment