diff --git a/src/core/js/edit_mode.js b/src/core/js/edit_mode.js index 5b97fe30d5ecd1cc4bd4e00bff366014d6dc58a9..d73227aaffa0ad65d6160fd294b350f5c3e1ed09 100644 --- a/src/core/js/edit_mode.js +++ b/src/core/js/edit_mode.js @@ -1389,7 +1389,25 @@ var edit_mode = new function () { // create inputs - var inputs = edit_mode.create_value_inputs(property); + if (property.reference && ("${BUILD_EDIT_MODE_LAZY_DROPDOWN_LOADING}" == "ENABLED")) { + // Only add button to load reference options lazily. + const editValueButton = $(`<button title="Edit this property" class="btn btn-link caosdb-update-entity-button-caosdb-f-list-item-button"><i class="bi-pencil"/></button>`); + $(editValueButton).click(() => edit_mode._addPropertyEditInputs(property, editfield)); + $(editfield).append(editValueButton); + // Trash button can exist without having to load all options + edit_mode.add_property_trash_button($(element).find(".caosdb-property-edit")[0], element); + } + else { + edit_mode._addPropertyEditInputs(property, editfield); + } + } + + /** + * Add input elements for value, units, list toggling, and + * deletion to a property row. + */ + this._addPropertyEditInputs(property, editfield) { + var inputs = edit_mode.create_value_inputs(property); editfield.children().remove(); editfield.append(inputs); // selectpicker is based on bootstrap-select and must be initializes