More efficient select options handling
authorColeman Watts <coleman@civicrm.org>
Fri, 10 Jan 2020 17:59:49 +0000 (12:59 -0500)
committerCiviCRM <info@civicrm.org>
Wed, 16 Sep 2020 02:13:21 +0000 (19:13 -0700)
commit4e35388cb4e75d12d8805247a9e623680def3553
tree1df283143df3df3a1c77baae714ce1b20ca58a5b
parent69c2d1a2601dff14a744d21e83ce46f2648c1a51
More efficient select options handling

The afField.getOptions function was causing infinite recursion by recreating the boolean options array every time.
Passing this variable by refernce solves the problem, and adding "track by" to the ng-repeat follows best-practices for efficiency.
ext/afform/core/ang/af/Field.js
ext/afform/core/ang/af/fields/CheckBox.html
ext/afform/core/ang/af/fields/Radio.html