custom fields: Fix custom fields header not rendering properly.

Even when admin removes all custom fields from org, custom
fields header "Profile" doesn't get removed.
Render header "Profile" whenever custom fields data get changed.
This commit is contained in:
Yashashvi Dave
2018-06-07 15:09:12 +05:30
committed by Tim Abbott
parent 5f7691b74e
commit a6c03a4738
2 changed files with 7 additions and 1 deletions

View File

@@ -69,6 +69,12 @@ exports.add_custom_profile_fields_to_settings = function () {
} }
$("#account-settings .custom-profile-fields-form").html(""); $("#account-settings .custom-profile-fields-form").html("");
if (page_params.custom_profile_fields.length > 0) {
$("#account-settings #custom-field-header").show();
} else {
$("#account-settings #custom-field-header").hide();
}
var all_custom_fields = page_params.custom_profile_fields; var all_custom_fields = page_params.custom_profile_fields;
all_custom_fields.forEach(function (field) { all_custom_fields.forEach(function (field) {

View File

@@ -124,7 +124,7 @@
</div> </div>
</form> </form>
<h3 class="inline-block" {{#unless page_params.custom_profile_fields}}style="display: none"{{/unless}}>{{t "Profile" }}</h3> <h3 class="inline-block" id="custom-field-header" {{#unless page_params.custom_profile_fields}}style="display: none"{{/unless}}>{{t "Profile" }}</h3>
<div class="alert-notification" id="custom-field-status"></div> <div class="alert-notification" id="custom-field-status"></div>
<form class="form-horizontal custom-profile-fields-form grid"></form> <form class="form-horizontal custom-profile-fields-form grid"></form>