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

ENH: Don't register the module if buld variable is not set

parent e71297ad
Branches
Tags
2 merge requests!89Release v0.10.0,!86F hide properties
Pipeline #31301 passed
......@@ -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);
}
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment