Skip to content

Commit

Permalink
Merge pull request #33853 from dimagi/riese/lazy_config_fix
Browse files Browse the repository at this point in the history
Only try to bind lazy load fields if they are present
  • Loading branch information
orangejenny authored Dec 7, 2023
2 parents 0695758 + 7735a90 commit cfc9011
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,13 @@ hqDefine("app_manager/js/modules/module_view", function () {
});
}

$('#lazy-load-case-list-fields').koApplyBindings({
lazy_load_case_list_fields: ko.observable(initial_page_data('lazy_load_case_list_fields')),
});
var lazyloadCaseListFields = $('#lazy-load-case-list-fields')
if (lazyloadCaseListFields.length > 0) {
lazyloadCaseListFields.koApplyBindings({
lazy_load_case_list_fields: ko.observable(initial_page_data('lazy_load_case_list_fields')),
});
}


// Registration in case list
if ($('#case-list-form').length) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% load i18n %}
{% load hq_shared_tags %}
<label class="control-label col-sm-2">
<label class="control-label col-xs-12 col-sm-4 col-md-4 col-lg-2">
{% trans "Lazy load Case List fields" %}
<span class="hq-help-template"
data-title="{% trans "Incrementally load case list fields" %}"
Expand Down

0 comments on commit cfc9011

Please sign in to comment.