diff --git a/src/core/js/ext_prop_display.js b/src/core/js/ext_prop_display.js index 1de71eae692d53aa317f70a101c7d3df3d93e481..629e2a4c1f21dd15346c5e6e9901c4c3b825ea39 100644 --- a/src/core/js/ext_prop_display.js +++ b/src/core/js/ext_prop_display.js @@ -180,15 +180,22 @@ var prop_display = new function ($, edit_mode, getEntityName, getEntityRole, get const allTypes = await this._getRecordTypes(conf); var entities = this.getEntitiesInView(); this.unhideProperties(entities, conf, allTypes); - edit_mode.app.onAfterShowResults = this._unhidePropertiesWrapper(edit_mode.app.onAfterShowResults, conf, allTypes); + // If we are in the edit mode, (un)hide properties after ending + // the editing of an entity + document.body.addEventListener(edit_mode.start_edit.type, (e) => { + edit_mode.app.onAfterShowResults = this._unhidePropertiesWrapper(edit_mode.app.onAfterShowResults, conf, allTypes); + }, true); + } else { this.unhideAllProperties(); - // also unhide properties when leaving the edit mode - // TODO(fspreck): We're lacking a proper state/event here in the - // edit mode, so do this on "init", since this is the state to which - // the state machine returns after either successfully saving an - // entity or canceling the edit. - edit_mode.app.onAfterShowResults = this._unhideAllPropertiesWrapper(edit_mode.app.onAfterShowResults); + document.body.addEventListener(edit_mode.start_edit.type, (e) => { + // also unhide properties when leaving the edit mode + // TODO(fspreck): We're lacking a proper state/event here in the + // edit mode, so do this on "init", since this is the state to which + // the state machine returns after either successfully saving an + // entity or canceling the edit. + edit_mode.app.onAfterShowResults = this._unhideAllPropertiesWrapper(edit_mode.app.onAfterShowResults); + }, true); } } }($, edit_mode, getEntityName, getEntityRole, getPropertyElements, getPropertyName, getUserName, getUserRoles, log.getLogger("ext_prop_display"), load_config, query);