* [bug#59023,done,0.2h] fix can't add deleted member.
This commit is contained in:
@@ -72,8 +72,29 @@ window.addItem = function(obj)
|
||||
*/
|
||||
window.deleteItem = function(obj)
|
||||
{
|
||||
let currentAccount = $(obj).closest('tr').find('input[name^=account]').val();
|
||||
|
||||
$(obj).closest('tr').remove();
|
||||
if($('#teamForm .table tbody tr').length < 2) $('#teamForm .table tbody tr .actions-list .btn-link').eq(1).addClass('hidden');
|
||||
|
||||
if(!currentAccount) return true;
|
||||
|
||||
let accountItems = JSON.parse(JSON.stringify(users));
|
||||
$('#teamForm [name^=account]').each(function()
|
||||
{
|
||||
if(!$(this).val()) return true;
|
||||
delete accountItems[$(this).val()];
|
||||
});
|
||||
|
||||
const userItems = [];
|
||||
for(let key in accountItems) userItems.push({text: accountItems[key], value: key});
|
||||
|
||||
$('#teamForm [name^=account]').each(function()
|
||||
{
|
||||
let $accountPicker = $(this).closest('input[name^=account]').zui('picker');
|
||||
if(typeof $accountPicker == 'undefined') return true;
|
||||
$accountPicker.render({items: userItems});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user