group-settings: Fix live-update of group permission settings.

This commit fixes code to correctly enable the permission
settings when a user gains permission to manage the group.
This commit is contained in:
Sahil Batra 2024-11-15 12:49:54 +05:30 committed by Tim Abbott
parent d2b29cef2d
commit 6bd322ac5d
1 changed files with 3 additions and 3 deletions

View File

@ -117,19 +117,19 @@ function update_group_permission_settings_elements(group) {
const $group_permission_settings = $("#group_permission_settings"); const $group_permission_settings = $("#group_permission_settings");
const $permission_pill_container_elements = $group_permission_settings.find(".pill-container"); const $permission_pill_container_elements = $group_permission_settings.find(".pill-container");
const $permission_input_groups = $group_permission_settings.find(".input-group");
if (settings_data.can_manage_user_group(group.id)) { if (settings_data.can_manage_user_group(group.id)) {
$permission_pill_container_elements.find(".input").prop("contenteditable", true); $permission_pill_container_elements.find(".input").prop("contenteditable", true);
$permission_pill_container_elements.removeClass("group_setting_disabled"); $permission_input_groups.removeClass("group_setting_disabled");
$permission_pill_container_elements.each(function () { $permission_input_groups.each(function () {
$(this)[0]._tippy?.destroy(); $(this)[0]._tippy?.destroy();
}); });
settings_components.enable_opening_typeahead_on_clicking_label($group_permission_settings); settings_components.enable_opening_typeahead_on_clicking_label($group_permission_settings);
} else { } else {
$permission_pill_container_elements.find(".input").prop("contenteditable", false); $permission_pill_container_elements.find(".input").prop("contenteditable", false);
const $permission_input_groups = $group_permission_settings.find(".input-group");
$permission_input_groups.addClass("group_setting_disabled"); $permission_input_groups.addClass("group_setting_disabled");
$permission_input_groups.each(function () { $permission_input_groups.each(function () {
settings_components.initialize_disable_button_hint_popover( settings_components.initialize_disable_button_hint_popover(