custom fields: Add icon to delete value of date-type-custom-field.

This commit is contained in:
Yashashvi Dave
2018-06-09 18:58:55 +05:30
committed by Tim Abbott
parent 52b6d0ce9f
commit 554a0773dc
3 changed files with 24 additions and 0 deletions

View File

@@ -400,6 +400,15 @@ exports.set_up = function () {
$("#deactivate_self_modal").modal("show");
});
$('#settings_page').on('click', '.custom_user_field .remove_date', function (e) {
e.preventDefault();
e.stopPropagation();
var field = $(e.target).parent('.custom_user_field').expectOne();
var field_id = parseInt($(field).attr("data-field-id"), 10);
$(e.target).prev(".custom_user_field_value").val("");
update_user_custom_profile_fields([field_id], channel.del);
});
$('#settings_page').on('change', '.custom_user_field_value', function (e) {
var fields = [];
var value = $(this).val();