settings_profile_fields: Pass Jquery consistently.

This commit is contained in:
afeefuddin 2024-05-10 17:13:20 +05:30 committed by Tim Abbott
parent 448870225b
commit e40ef29e63
2 changed files with 3 additions and 3 deletions

View File

@ -271,7 +271,7 @@ function add_choice_row(e) {
// which will not have the delete button so that there is at least one option present.
$curr_choice_row.find("button.delete-choice").show();
const choices_div = e.delegateTarget;
create_choice_row(choices_div);
create_choice_row($(choices_div));
}
function delete_choice_row(row) {
@ -665,7 +665,7 @@ export function do_populate_profile_fields(profile_fields_data) {
function set_up_select_field() {
const field_types = realm.custom_profile_field_types;
create_choice_row("#profile_field_choices");
create_choice_row($("#profile_field_choices"));
if (current_user.is_admin) {
const choice_list = $("#profile_field_choices")[0];

View File

@ -36,7 +36,7 @@ function get_chosen_default_streams() {
function create_choice_row() {
const $container = $("#default-stream-choices");
const value = settings_profile_fields.get_value_for_new_option("#default-stream-choices");
const value = settings_profile_fields.get_value_for_new_option($container);
const stream_dropdown_widget_name = `select_default_stream_${value}`;
const row_html = render_default_stream_choice({value, stream_dropdown_widget_name});
$container.append($(row_html));