From 5962a0d4ac9f9fabd9fcb604476ec7c353477e94 Mon Sep 17 00:00:00 2001 From: Brice Maron Date: Mon, 7 May 2012 21:27:03 +0000 Subject: [PATCH] Enhance user creation (avoid create+delete row), clear create user form after action --- settings/js/users.js | 56 +++++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/settings/js/users.js b/settings/js/users.js index 33872ceaf7..971da7abe9 100644 --- a/settings/js/users.js +++ b/settings/js/users.js @@ -167,32 +167,7 @@ $(document).ready(function(){ } var password=$('#newuserpassword').val(); var groups=$('#newusergroups').prev().children('div').data('settings').checked; - var tr=$('#content table tbody tr').first().clone(); - tr.attr('data-uid',username); - tr.find('td.name').text(username); - var select=$(''); + select.data('username',username); + select.data('userGroups',groups.join(', ')); + tr.find('td.groups').empty(); + var allGroups=$('#content table').data('groups').split(', '); + for(var i=0;i'+group+'')); + }); + tr.find('td.groups').append(select); + if(tr.find('td.remove img').length==0){ + tr.find('td.remove').append($('Delete')); + } + applyMultiplySelect(select); + $('#content table tbody').last().append(tr); + + tr.find('select.quota option').attr('selected',null); + tr.find('select.quota option').first().attr('selected','selected'); + tr.find('select.quota').data('previous','default'); + } } ); });