Skip to content
Snippets Groups Projects
Commit b4d2ba9f authored by florian's avatar florian
Browse files

WIP: Add show preview event

parent 2bbe6b1b
No related branches found
No related tags found
1 merge request!92F fix hidden prop in preview
Pipeline #32719 passed
......@@ -210,22 +210,26 @@ var prop_display = new function ($, edit_mode, getEntityName, getEntityRole, get
this.displayProperties(entities, conf, allTypes, userName, userRoles);
// 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._displayPropertiesWrapper(edit_mode.app.onAfterShowResults, conf, allTypes);
}, true);
for (let event_t of [edit_mode.start_edit.type, preview.showPreviewEvent.type]) {
document.body.addEventListener(event_t, (e) => {
edit_mode.app.onAfterShowResults = this._displayPropertiesWrapper(edit_mode.app.onAfterShowResults, conf, allTypes);
}, true);
}
} else {
// There are no properties to be hidden, so make this clear in HTML body
$("body").attr("data-hidden-properties", "false")
this.unhideAllProperties();
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);
for (let event_t of [edit_mode.start_edit.type, preview.showPreviewEvent.type]) {
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);
......
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