diff --git a/src/core/js/ext_prop_display.js b/src/core/js/ext_prop_display.js index 629e2a4c1f21dd15346c5e6e9901c4c3b825ea39..847608ac7c8548b8b91b4129cdbd13a735bed0ab 100644 --- a/src/core/js/ext_prop_display.js +++ b/src/core/js/ext_prop_display.js @@ -174,9 +174,7 @@ var prop_display = new function ($, edit_mode, getEntityName, getEntityRole, get this.init = async function () { const conf = await this.load_config(); - if (("${BUILD_MODULE_EXT_PROPERTY_DISPLAY}" == "ENABLED") && Object.keys(conf).length > 0) { - // There are properties to be hidden, so make this clear in HTML body - $("body").attr("data-hidden-properties", "true") + if (Object.keys(conf).length > 0) { const allTypes = await this._getRecordTypes(conf); var entities = this.getEntitiesInView(); this.unhideProperties(entities, conf, allTypes); @@ -187,6 +185,8 @@ var prop_display = new function ($, edit_mode, getEntityName, getEntityRole, get }, 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 @@ -200,4 +200,8 @@ var prop_display = new function ($, edit_mode, getEntityName, getEntityRole, get } }($, edit_mode, getEntityName, getEntityRole, getPropertyElements, getPropertyName, getUserName, getUserRoles, log.getLogger("ext_prop_display"), load_config, query); -$(document).ready(() => caosdb_modules.register(prop_display)); +$(document).ready(() => { + if ("${BUILD_MODULE_EXT_PROPERTY_DISPLAY}" == "ENABLED") { + caosdb_modules.register(prop_display); + } +});