Refactor settings logic; streamline brand and item type creation, enhance ComboBoxWidget integration for improved usability
This commit is contained in:
parent
c6fc1a4795
commit
347baaa12e
3 changed files with 40 additions and 35 deletions
|
@ -21,19 +21,13 @@
|
|||
</select>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
ComboBoxWidget.initComboBox("{{ id }}", {
|
||||
onAdd: function(newItem, list, createOption) {
|
||||
{% if onAdd %}
|
||||
{{ onAdd | safe }}
|
||||
{% else %}
|
||||
ComboBoxWidget.handleComboAdd('{{ id }}-input', '{{ id }}-list', '{{ id }}s', '{{ label or id }}');
|
||||
{% endif %}
|
||||
},
|
||||
{% if onRemove %}onRemove: function(option) { {{ onRemove | safe }} },{% endif %}
|
||||
{% if onEdit %}onEdit: function(option) { {{ onEdit | safe }} }{% endif %}
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
ComboBoxWidget.initComboBox("{{ id }}", {
|
||||
{% if onAdd %}onAdd: function(newItem, list, createOption) { {{ onAdd | safe }} },{% endif %}
|
||||
{% if onRemove %}onRemove: function(option) { {{ onRemove | safe }} },{% endif %}
|
||||
{% if onEdit %}onEdit: function(option) { {{ onEdit | safe }} }{% endif %}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
{% endmacro %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue