Merge pull request #1885 from houqp/issue_1776

when user changes displayName, also update it on expand button
This commit is contained in:
Frank Karlitschek 2013-02-26 00:19:42 -08:00
commit 072daf8850
2 changed files with 5 additions and 2 deletions

View File

@ -34,7 +34,7 @@
<ul id="settings" class="svg">
<span id="expand">
<?php echo $_['user_displayname'] ?>
<span id="expandDisplayName"><?php echo $_['user_displayname'] ?></span>
<img class="svg" src="<?php echo image_path('', 'actions/caret.svg'); ?>" />
</span>
<div id="expanddiv">

View File

@ -31,7 +31,7 @@ $(document).ready(function(){
}
});
$("#displaynamebutton").click( function(){
if ($('#displayName').val() != '' ) {
// Serialize the data
@ -42,6 +42,9 @@ $(document).ready(function(){
$.post( 'ajax/changedisplayname.php', post, function(data){
if( data.status == "success" ){
$('#displaynamechanged').show();
$('#oldDisplayName').text($('#displayName').val());
// update displayName on the top right expand button
$('#expandDisplayName').text($('#displayName').val());
}
else{
$('#newdisplayname').val(data.data.displayName)