]> source.dussan.org Git - nextcloud-server.git/commitdiff
update oldDisplayName value on displayName change
authorQingping Hou <dave2008713@gmail.com>
Sun, 24 Feb 2013 23:13:25 +0000 (18:13 -0500)
committerQingping Hou <dave2008713@gmail.com>
Sun, 24 Feb 2013 23:13:25 +0000 (18:13 -0500)
This patch fixes a bug that can be reproduced in following way:

1. change displayName
2. clear text in displayName input click change again

Then you will get an error and previous displayName will be restored.

Expected behavior should restore the new updated displayName.

settings/js/personal.js

index c5a46a16002a710c2ab4aa0685b7918626485697..8747c4960412f274e5e12e4db1eeea624d27b0a8 100644 (file)
@@ -42,6 +42,7 @@ $(document).ready(function(){
                        $.post( 'ajax/changedisplayname.php', post, function(data){
                                if( data.status == "success" ){
                                        $('#displaynamechanged').show();
+                                       $('#oldDisplayName').val($('#displayName').val());
                                        // update displayName on the top right expand button
                                        str_parts = $('#expand').html().split('\t');
                                        str_parts[5] = $('#displayName').val();