Skip to content
Snippets Groups Projects
Commit 59ba2599 authored by Florian Spreckelsen's avatar Florian Spreckelsen
Browse files

WIP: Lazy-load dropdown options

parent c3274509
No related branches found
No related tags found
2 merge requests!142REL: Release 0.15.0,!141F lazy edit mode dropdowns
Pipeline #55517 failed
...@@ -1389,6 +1389,24 @@ var edit_mode = new function () { ...@@ -1389,6 +1389,24 @@ var edit_mode = new function () {
// create inputs // create inputs
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); var inputs = edit_mode.create_value_inputs(property);
editfield.children().remove(); editfield.children().remove();
editfield.append(inputs); editfield.append(inputs);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment